Apr-27-2020, 10:16 AM
(This post was last modified: Apr-27-2020, 10:16 AM by pyzyx3qwerty.)
Please use proper code tags while posting your thread. It will be much clearer for us to understand.
So, when you run the code, you have to understand what do you mean by
Hope this helps!
So, when you run the code, you have to understand what do you mean by
for a in range(1,5):
. That basically means all the integers from 1 to 5, excluding 5 itself. Now, you have added another statementfor b in range([0+[a*2]-2],2*a) :
. First of all, you should understand that when you type [0+[a*2]-2]
, python takes that as a list and therefore, the error:Error:TypeError: unsupported operand type(s) for +: 'int' and 'list'
So, use the parentheses(), instead of square brackets. The square brackets[] is specifically used in listsHope this helps!
pyzyx3qwerty
"The greatest glory in living lies not in never falling, but in rising every time we fall." - Nelson Mandela
Need help on the forum? Visit help @ python forum
For learning more and more about python, visit Python docs
"The greatest glory in living lies not in never falling, but in rising every time we fall." - Nelson Mandela
Need help on the forum? Visit help @ python forum
For learning more and more about python, visit Python docs