Adding a tuple to the end of the basic tuple in python
July 30, 2016 ·
2 mins read
Categories:
Django
|
Six weeks training
|
Another problem was encountered while working on the python web framework, Django. But this time the problem was more of the language oriented rather than being framework oriented. As I am not a python programmer so I never knew these basic things. So, first of all I was getting an error, whose statement went like this : First of all I will like to tell the things that I wanted to iterate over were stored in list and the list has many tuples inside it.
<code>[('name1'), ('name2')]</code>
<code>(('abc1','xyz1'),('abc2', 'xyz2'))</code>
<code>l=tuple(l)</code>
<code>x = 0
for q in name:
z=((q.id, q.Name),)+z
x = x+1</code>
Please share your Feedback:
Did you enjoy reading or think it can be improved? Don’t forget to leave your thoughts in the comments section below! If you liked this article, please share it with your friends, and read a few more!