What's the output? print(Hello, World!)
Syntax Error
What's the result?
1 // 2
0
What operator checks if two values are NOT EQUAL to each other
print("A", "B","C", sep = "sep")
Which version of Python are we working in ?
def func(a , b):
return b ** a
print(func(b=2, 2))
Is this code erroneous?
Yes
What's the output?
x = 1 // 5 + 1 / 5
0.2
Is this variable name illegal?
for
yes, it's a keyword
The meaning of a positional argument is determined by it's________
position
Who created Python?
Guido Van Rossum
def fun(i = 2, o = 3):
return i * o
print(fun(o = 2))
what's the output
4
What's the output?
x = 1 // 10 + 3 // 5 + 2
2
Is this variable name illegal?
in
yes, it is a keyword
x = input()
y = input()
print(x + y)
What's the output? The inputs are 4 and 7.
Is Python an interpreted or compiled language?
interpreted
What value is assigned to x?
z = 5
y = 10
x = y<z and z>y or y>z or z>y
True
What's the output if the user enters 2 and 6?
x = float(input())
y = float(input())
print(y ** (1/x))
3.0
a = 1
b = 0
a = a ^ b
b = a ^ b
a = a ^ b
print(a,b)
0 1
Is this variable name illegal?
And
No, but and is
What's the output?
d = {"1": "0", "0": "1"}
for x in d.vals():
print(x, end = "")
code is erroneous, dict object doesn't have vals method
What's the output?
x = 1
y = 2
x,y,z =x,x,y
z,y,z = x,y,z
print(x,y,z)
1 1 2
def fun( x , y ):
if ( x == y):
return x
else:
return fun(x, y - 1)
print(fun(0,3))
0
Is this code wrong? Why or why not is it wrong?
tuple[1] = tuple [1] + tuple [0]
Wrong, tuples are immutable
How many stars will be printed?
i = 0
while i < i + 2:
i+= 1
print("*")
else:
print("*")
infinite loop will occur
What's the output?
tup = (1,2,6,8)
tup = tup[-2:-1]
tup = tup[-1]
print(tup)
(6,)