Python tuple packing and unpacking python tuple can also be created without using a tuple() class or enclosing the items inside the parentheses. it is called the variable packing #python tuple packing into tuple tuple=23,44,66,'django' print(tuple) print(type(tuple)) #unpacking tuple into variable a,b,c,d=tuple print("a is =",a) print("b is =",b) print("c is =",c) print("d is =",d) print(type(a)) print(type(b)) print(type(c)) print(type(d)) output : (23, 44, 66, 'django') <class 'tuple'> a is = 23 b is = 44 c is = 66 d is = django <class 'int'> <class 'int'> <class 'int'> <class 'str'>
PythonDjangoFlask is Blogging website that covers all Python Django Flask Framework Topics and Real Time Training, How to done Real time projects in Full stack Python . Training Courses : C,C++,Java,Python,PHP,Web Designing,Web Development,Frontend Technologies,Html,css,javascript,Bootstrap,Reactjs,Angualrjs,Wordpress,Drupal
Comments
Post a Comment