Python Quiz-4



PYTHON QUIZ ONLINE



Basic python quiz which includes questions on python operators, datatypes like list , loops , conditional statements.The answers for the question is shown below.

1. Which of the following operation can be used in a string ?
  1. +
  2. -
  3. /
  4. %
2. ____ operator is used to find whether a character is present in a string ?
  1. not
  2. as
  3. in
  4. or
3. Find the length of the string , "apple" .
  1. 4
  2. 5
  3. 1
  4. 0
4. The built-in function to count the occurrence of element in a list is __
  1. Coun
  2. occur
  3. count
  4. num
5. The function used to convert the characters to lowercase ?
  1. lowercase()
  2. shift()
  3. lower()
  4. small_lett()
6. An empty set is represented as ____
  1. {}
  2. []
  3. ()
  4. set()
7. _____ function returns true if all characters in a string are letters ?
  1. isalpha()
  2. isletter()
  3. isbeta()
  4. ischar()
8. Which of the following adds new line in python .
  1. \n
  2. new_line
  3. /n
  4. /N
9. S[2] in S= "band" is _____
  1. a
  2. n
  3. b
  4. d
10. S[-1] in S="band" ____
  1. a
  2. n
  3. b
  4. d

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