PYTHON QUIZ 4

 



   Start date :- 28/04/2021                                End date :- 11/05/2021


PYTHON QUIZ 4..

____________________________________________________________________________________________________

Q.1. How do you declare a dictionary in python ?

1.
2.
3.
4.

ANSWER :- (2)  Dictionary in python is declared by enclosing a comma-separated list of key-value pairs using curly braces thus 2 option is correct.


____________________________________________________________________________________________________  

Q.2. What will be the output of the following code:
        dict = { x:x for x in range(1,2) }
        print(dict)

1.
2.
3.
4.
ANSWER :-  (4) it will return {1: 1} as output as loop runs only once.

____________________________________________________________________________________________________  
Q.3. In python 3.x, Which of the following statement is true for following code:
        age = input (“Please enter your age”)
1.
2.
3.
4.
ANSWER :- (4) here it is asking age but no given format to enter thus none of above statements are true.

_________________________________________________________________________________________________  
Q.4. What will be the output of the following program ?

int =5
while int <=-1:
print (int)
int = int -1

1.
2.
3.
4.
_______________________________________________________________________________________________  

Comments

Post a Comment