Prof. Jose María Alvarez Rodríguez
2023
while len(x) > 1:
v = x[0]
del x[0]
print(x[0])
x = "Hello"
v = ""
i = 0
while i<len(x):
if i % 2 == 0:
v = v + (x[i]*2)
else:
v = v + (x[i])
i = i + 1
ROUND 1
14 | X | Input/Output |
---|---|---|
[4,8] | 7 | X |
X | HHellloo | immutable |
values = [4, 15, 9, 10]
other_values = []
k = 10
for v in values:
if v < k:
other_values.append(v)
v1 = [4,5,6]
v2 = [5,7,8,9]
v3 = []
for v in v1:
if v2.count(v) != 0:
v3.append(v)
a = 2
b = 3
if a > b:
print(a)
elif:
print(b)
x = [4, 8, 10]
i = 0
while i < len(x):
print(x[i])
i = i - 1
ROUND 2
Error | X | Compilation error |
---|---|---|
mutable | [4,9] | X |
X | [5] | Runtime error |
s1 = "This is a string"
s2 = s1
s3 = "This is a string"
if s1 is s2:
if s3 == s2:
print("IS ==")
else:
print("IS NOT")
l1 = [7, 5]
l2 = [4]
result = []
for v in l1:
for w in l2:
result.append([v,w])
value = (3%2 == 1) and not (True) or True
print (value)
a = 3
b = 3
c = 1
for i in range(0,b):
c *= a
print(c)
ROUND 3
2 | X | Software |
---|---|---|
IS == | [[7, 4], [5, 4]] | X |
X | True | 27 |