What will this code do?
import time
my_time = time.strptime("Mon Feb 22 10:55:00 2021")
my_time = time.strftime("%d.%m.%Y", my_time)
print(my_time)
What will this code do?
import time
time.asctime((2021, 2, 23, 12, 0, 0, 1, 0, 0))
What will this code do?
def f(**x):
return sum(x.values())
s = f(a=1, b=2) + f(x=2, y=1, z=0)
print(s)
Choose your answer
Anonymous Quiz
0%
(1, 2, 2, 1, 0)
0%
{"a":1, "b":2, "x":2,"y":1, "z":0}
0%
3
94%
6
6%
{1, 2, 2, 1, 0}
0%
0
0%
See solution
What will this code do?
x = (i**2 for i in range(1, 100) if not i % 3)
y = (i for i in x if not i % 5)
print(next(y))
What will this code do?
import hashlib
m = hashlib.sha256()
m.update(b"hello")
print(m.digest_size, len(m.hexdigest()))
Choose your answer
Anonymous Quiz
0%
5 5
0%
5 10
13%
32 32
25%
32 64
63%
256 256
0%
256 512
0%
See solution
What will this code do?
import datetime
t1 = datetime.date(2021, 3, 5) - datetime.date(2021, 2, 23)
t2 = datetime.date(2020, 3, 5) - datetime.date(2020, 2, 23)
print((t2 - t1).days)
Choose your answer
Anonymous Quiz
0%
-1
55%
0
18%
1
0%
5
0%
10
0%
11
0%
23
18%
ValueError
0%
TypeError
9%
See solution
What is the largest integer that can be in a variable?
Anonymous Quiz
12%
2**32 - 1
27%
2**64 - 1
0%
2**52 - 1
12%
2**256 - 1
12%
2**1024 - 1
38%
Limited only by computer memory
What will this code do?
class A:
def f(self):
print('A', end="")
class B:
def f(self):
print('B', end="")
class C(A):
def f(self):
print("C", end="")
super().f()
self.__class__.__bases__ = (B,)
x = C()
_ = x.f(), x.f()
What will this code do?
class B:
def __init__(self) :
print ('В', end='')
super().__init__()
class C:
def __init__(self):
print('C', end='')
super().__init__ ()
class D(B, C):
def __init__(self):
print('D', end='')
B.__init__(self)
C.__init__(self)
X = D()
What will this code do?
class A:
def f(self):
print("A", end="")
class B(A):
def f(self):
print("B", end="")
super().f()
A.f(self)
class C(A):
def f(self):
print("C", end="")
super().f()
A.f(self)
class D(B, C):
def f(self):
print("D", end="")
super().f()
d = D()
d.f()
Choose your answer
Anonymous Quiz
27%
DBACA
9%
DBACAA
9%
DBCA
0%
DBCAA
9%
DBCAAA
27%
DBAACA
18%
See solution