Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
class A:
def __new__(cls):
return 42
def __init__(self):
print("Init")
print(A())
#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
d = {'a': 1, 'b': 2, 'c': 3}
try:
for k in d:
del d[k]
print(len(d))
except RuntimeError:
print("RuntimeError")#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
def calculate(x, y):
if x > y:
return x - y
else:
return y - x
result = calculate(10, 15) + calculate(20, 8)
print(result)
#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
def increment(x):
x += 10
return x
value = 5
new_value = increment(value)
print(value + new_value)
#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
class A:
def __new__(cls):
return 42
def __init__(self):
print("Init")
print(A())
#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
data = {'a': [1, 2], 'b': [3, 4]}
data['c'] = data['a'] + data['b']
data['a'].append(5)
print(len(data['c']))#Python
Please open Telegram to view this post
VIEW IN TELEGRAM