Skip to content

Instantly share code, notes, and snippets.

View pranjalAI's full-sized avatar

Pranjal Saxena pranjalAI

View GitHub Profile
mylst = [10,20,30]
a,b,c = mylst
print(c, a, b )
print(a, c, b )
sum(i for i in range(5) )
str ="Python"
print(str * 4)
matrix=[(1,2,3),(4,5,6),(7,8,9),(10,11,12)]
t_matrix = zip(*matrix)
for row in t_matrix:
print(row)
text = "Learning python"[::-1]
print(text)
import sys
mylst = ['India', 'Paris', 'London', 'Italy', 'Rome']
print("size of list = ",sys.getsizeof(mylst))
i = 50
j = 100
i, j = j, i
print("i =", i)
print("j =", j)
i = 50
j = 100
temp = i
i = j
j = temp
print('The value of i after swapping: {}'.format(i))
print('The value of j after swapping: {}'.format(j))
arr1 = ['T', 'r', 'i', 'c', 'k', 's']
res = "".join(arr1)
print (res)
Numbers = [30, 32, 14, 26, 18, 18, 20, 30, 28]
print("Original= ", Numbers)
Numbers = list(set(Numbers))
print("After removing duplicate= ", Numbers)