Created 3 years ago
input_string = "I love Python"
k = [(i.upper(), len(i)) for i in input_string.split(' ')]
print(k)
[('I', 1), ('LOVE', 4), ('PYTHON', 6)]
var = [i**2 for i in range(5)]
print(var)
[0, 1, 4, 9, 16]
l1=[1,2,3,7]
l2=[4,5,6,9]
[x+y for x in l1 for y in l2]
[5, 6, 7, 10, 6, 7, 8, 11, 7, 8, 9, 12, 11, 12, 13, 16]
def function(n):
n=n+1
n=2
print(function(2))
None
x=10
def func(x):
x=20
print(x)
print(x)
10
10