1import math
2def isPalin(n):
3 m=n
4 sum=0 5 while(m!=0):
6 r=m%10
7 sum=sum*10+r
6 return flag
7
8def sumPrime(n):
9 sum=210 for i in range(3,n,2):
11 if(isPrime(i)):
12 sum+=i
1# cook your dish here
2tc = int(input())
3for _ in range(tc):
4 str = input() 5 d1 = {}
6 d2 = {}
7 n = len(str)
1#link:-https://www.codeabbey.com/index/task_view/reverse-string
2import string
3str = input()4print(str[::-1])
3 s = input()
4 list = []
5 list = s.split(" ")
6 sum=0 7 for i in range(len(list)):
8 sum+=int(list[i])**2
9 print(sum, end=" ")
Defining a local variable or function with the same name as a built-in object makes the built-in object unusable within the current scope and makes the code prone to bugs.
dict = {} # dict is a Python builtin!
for idx, student in enumerate(students):
dict[student] = idx
roll_number = {}
for idx, student in enumerate(students):
roll_number[student] = idx