Quick actions

cmd+k|ctrl+k

Navigation

Languages

Lesson06

Snippet info

Language

Python

Visibility

public

Author

victormakwaitat

Created

2024-10-03T11:59:32.526156Z

Updated

2024-10-03T13:54:51.992919Z

x = 1
'''while True:
    x += 1
    if x == 10:
        continue
    if x == 12:
        break
    print(x)
else:
    print("while never run")
    print("x is equal to 10")'''
    
#print(x)

'''x = 1
while x < 13:
    for i in range(15):
        x += 1
        if x == 10:
            continue
        if x == 12:
            break
        print(i , x)
else:
    print("while never run")'''
    
'''x = 1
while x < 13:
    for i in range(15):
        x += 1
        if x == 10:
            continue
    #break
        print(i , x)
else:
    print("while never run")'''
    
'''    
try:
    x = 1/0
except ZeroDivisionError:
    print("division by zero")
finally:                        #finally --> close data file
    print("file closing")'''
'''    
try:
    x = 1/0
except ZeroDivisionError:
    print("division by zero")
else:                        #finally --> close data file
    print("file closing")'''
    
    
'''x = 1
while True:
    x += 1
    if x == 10:
        raise'''
    
def y():
    print('this is function y')
    
x = {"a" : 1, 'b' : 2, 'c' : y}
print(x['c']())
INFO