Contents

Which of these in not a core data type?
a) Lists                                  
b) Dictionary
c) Tuples                                               
d) Class

d

Explanation: Class is a user defined data type.


Given a function that does not return any value, What value is thrown by default when executed in shell.
a) int                                      
b) bool
c) void                                   
d) None

d

Explanation: Python shell throws a NoneType object back.


Which of the following will run without errors?
a) round(45.8)
b) round(6352.898,2,5)     
c) round()
d) round(7463.123,2,1)

a

Explanation: Execute help(round) in the shell to get details of the parameters that are passed into the round function.


What is the return type of function id?
a) int                                     
b) float
c) bool                                   
d) dict

a

Explanation: Execute help(id) to find out details in python shell.id returns a integer value that is unique.


In order to store values in terms of key and value we use what core data type.
a) list                                     
b) tuple
c) class                                  
d) dictionary

d

Explanation: Dictionary stores values in terms of keys and values.


Which of the following results in a SyntaxError?
a) ‘”Once upon a time…”, she said.’
b) “He said, ‘Yes!'”
c) ‘3\’                                    
d) ”’That’s okay”’

c

Explanation: Carefully look at the colons.