0

type(hh)==?

hh=[2,3] print(type(hh)) output==> <class 'list'> But when I write this--> if type(hh)==<class 'list'>: print('ok') It shows syntax error. When I write if type(hh)=="<class 'list'>": print('ok') It doesn’t print anything Also when I write if type(hh)=='list': print('ok') still it doesn’t print anything. How to make the if clause work?

7th Mar 2021, 6:46 AM
Mir Abir Hossain
Mir Abir Hossain - avatar
2 Answers
+ 1
Rishav Tiwari thanks! A good article to read and learn from
7th Mar 2021, 6:55 AM
Mir Abir Hossain
Mir Abir Hossain - avatar