+ 2
Problem with asteric(*) variable and type
When I write this code it shows error. a,*b='abcdef' print(*b,type(*b)) It throws a error that type() takes 1 or 3 argument. How to know the type of '*b' and can anyone give me a example of type() taking 3 arguments. What it actually mean?
9 Answers
+ 4
You can do it like this:
a,*b='abcdef'
print(*b,type(b))
+ 2
Thanks a lot. The article clears the confusions.
+ 1
https://docs.python.org/3/library/functions.html#type
+ 1
thank you ^_^
+ 1
Thanks ^_^
+ 1
now it shows <class 'list'>
+ 1
I wanted to know the type of (*b)