Python Basic Quiz-2


Python Quiz-2




PYTHON QUIZ ONLINE




1. Which of the following datatype is immutable ?
  1. String
  2. List
  3. Tuple
  4. Both A and C
2. Which among the following is true regarding variable names in python ?
  1. A variable can start with a number
  2. A variable can have spaces in between
  3. Case doesn’t matter i.e. num and Num are same
  4. A variable can contain underscores
3. Which one is not true about for loops ?
  1. The word “for” must be in lower case
  2. The first line must end with a semi colon
  3. Statements to be repeated must be indented
  4. It may have nested loops
4. The range function can have almost ____ parameters .
  1. 3
  2. 2
  3. 1
  4. 4
5. Which of the following operators denotes integer division ?
  1. /
  2. //
  3. %
  4. \
6. Which of the following is not correctly matched?
  1. 5 - int
  2. 2.3 - float
  3. "abcd" - str
  4. 9a - char
7. Which of the following operators is used for exponentiation?
  1. &
  2. *
  3. ^
  4. **
8. Math module consists of familiar math functions . True or false ?
  1. False
  2. True
9. Which of the following is not a function from random module ?
  1. randint
  2. randrange
  3. randmath
  4. random.choice
10. Which of the following is used to write a a multi line comment?
  1. *This is a comment*
  2. " " " This is a comment " " "
  3. #This is a comment
  4. /*This is a comment*/

Comments

Popular posts from this blog

Finding the percentage in python - HackerRank solution

HackerRank challenges with solutions (Rearrangement, Formula, Word sorting, Numbers, Sentence)

ginortS in Python - HackerRank solution