-3

tup=(1,'2',3.3,(1,4))

lst=list(map(type,tup))

print(lst)

for item in last:

if(item==class str)

print("success")

here "class str" is keyword but it is also the item of lst, any possible syntax to do conditional operations on keywords

1 Answers1

0

Perhaps this is what you want

tup=(1,'2',3.3,(1,4))  #this is my tuple 
lst=list(map(type,tup))   #It stores the data types of elements of tuple in a list
print(lst)  #prints the list
for item in lst:
   if item is str: # here "class str" is keyword but it is a item of lst,is there any possible syntax

        print("succesful")