In python ,how can we perform conditional operations list where items or elements of list are keywords

Asked By: Anonymous

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


Solution

Answered By: Anonymous

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")
techinplanet staff

techinplanet staff


Windows 10 Kaufen Windows 10 Pro Office 2019 Kaufen Office 365 Lizenz Windows 10 Home Lizenz Office 2019 Home Business Kaufen windows office 365 satın al follower kaufen instagram follower kaufen porno