>>> i=0
>>> while i<len(a.keys()):
... print(a[list(a.keys())[i]])
... i=i+1
...
Ambiorix
43
195
>>> i=0
>>> while i<len(a.keys()):
... print(a[list(a.keys())[i]])
... i=i+1
...
Ambiorix
43
195
try:
result = 10 / a
except Exception as e:
print(f"An unexpected error occurred: {e}")
else:
print("Codigo funciona")
finally:
print("Siempre corre")
# Online Python compiler (interpreter) to run Python online.
# Write Python 3 code in this online editor and run it.
def test(i):
n=0
while n<i:
if n==3:
yield 'We reached the limit'
else:
yield n
n=n+1
m=test(24)
print(next(m))
print(next(m))
print(next(m))
print(next(m))
///////
0
1
2
We reached the limit
i=0
m=True
while m:
print(i)
i+=1
if i==10:
m=False
0
1
2
3
4
5
6
7
8
9
l1=[1,2,5,6]
l2=[7, 1, 3, 5, 6]
def find_missing_number(l1):
max_n=max(l1)+1
min_n=min(l1)
c=[a for a in range(min_n,max_n) ]
missing_n=[a for a in c if a not in l1]
return missing_n
print(find_missing_number(l1))
print(find_missing_number(l2))
[3, 4]
[2, 4]
def mycase(v):
d={"A":13,"B":14,"C":22}
if v in d.keys():
return d[v]
else:
return 0
print(mycase("C"))
https://cloud.google.com/video-intelligence/docs/streaming/live-streaming