print 2*3**2
What arithmetic operators cannot be used with strings?
How to copy one list to another in python?
What is the output of the following Python code?
>>>exec('a=2;b=3;print(a+b)')
What will be the output of the following Python code?
d = {0: 'a', 1: 'b', 2: 'c'}
for x in d.keys():
print(d[x])
What will be the output of the following Python code snippet?
a={1:"A",2:"B",3:"C"}
print(a.get(1,4))
What will be the output of the following Python code?
def foo(fname, val):
print(fname(val))
foo(max, [1, 2, 3])
foo(min, [1, 2, 3])
What will be the output of the following Python code?
sentence = 'we are humans'
matched = re.match(r'(.*) (.*?) (.*)', sentence)
print(matched.groups())
The number of lines drawn in each case, assuming that the turtle module has been imported:
Case 1:
for i in range(0,10):
turtle.forward(100)
turtle.left(90)
Case 2:
for i in range(1,10):
turtle.forward(100)
turtle.left(90)
What will be the output of the following code?
from calendar import *
print(weekheader(2)+"\n")
print(weekheader(5)+'\n')