Question | Answer |
---|---|
Coding questions | |
Given the following piece of code:
def f(x) :
x.append('John')
myList = [ 1, 2, 3 ]
f(myList)
What would be the value of myList in the end ?
|
|
What are the rules for local and global variables in python functions ?
Example of code:
MAX = 100
def is_allowed(i):
if i < MAX:
return True
else:
return False
|
|
Is multiple inheritance supported in python ? | |
list1 = [ 1, 2, 3 ]
list2 = list1
list1.append(4)
Has list2 changed ?
|
|
What does the % operator ? | |
What does the following return ?
dir("john")
|
|
What is a dictionnary ? | |
Given the following class:
class Aircraft:
def prepare_for_take_off(self, remaining_time, runway):
self.go_to_runway(runway)
self.start_timer(remaining_time)
Is 'self' a reserved word of the language ?
|
|
Other questions | |
What are .pyc files ? | |
Give examples of things that change between python v2 and python v3 |