VITyarthi Python Essentials Module 8 Quiz Answer

Question 1

Which of the following is False regarding loops in Python??

  1. Loops are used to perform certain tasks repeatedly.
  2. Loop is executed repeatedly until the given condition becomes False.
  3. Loop is executed repeatedly until the given condition becomes True.
  4. Loop can be used to iterate the sequences like an array, list, dictionary, tuple, dictionary, and set.

4. Loop can be used to iterate the sequences like an array, list, dictionary, tuple, dictionary, and set.

Question 2

How many times Hi will be printed? for i in range(10): print(“Hi”)?

10

Question 3

How many times Hi will be printed? for i in range(-10): print(“Hi”)?

0

Question 4

What is the final value of i? for i in range(10): pass print(i) ​?

9

Question 5

What is the output of the following code? if True: print(“Welcome to VITYARTHI”) else: print(“Welcome to Python Essentials”)?

  1. Welcome to VITYARTHI
  2. Welcome to Python Essentials
  3. Both
  4. None
  1. Welcome to VITYARTHI

Question 6

What is the output of the following code? if(print(“Hi”)): print(“Greetings”) else: print(“Good Bye”)?

  1. Hi Good Bye
  2. Hi
  3. Good Bye
  1. Hi Good Bye

Question 7

Which is invalid if statements??

  1. if a == b:
  2. if a>=2 :
  3. if a!=2:

4. elseif

Question 8

What is the output of the following code? if 4+6==10: print(“TRUE”) else: print(“False”) print (“TRUE”)?

  1. TRUE TRUE
  2. TRUE False
  3. False TRUE
  4. None
  1. TRUE TRUE

If you find anything wrong in this Answer Key, feel free to reach us in the comment section.

Sharing Is Caring:

Leave a Comment