Python Forum
Printing a new python list - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Printing a new python list (/thread-12261.html)



Printing a new python list - abdallah786 - Aug-16-2018

list = 100
if list > 99:
print(list=list(range(100,500))



why wont this work? can you help fix this?


RE: Printing a new python list - Axel_Erfurt - Aug-16-2018

list = 100

is not a list

list = [98, 99, 100, 101]

is a list

if you want to make a list from 100 to 500

list = []
for x in range(100, 501):
    list.append(str(x))

print("\n".join(list))



RE: Printing a new python list - abdallah786 - Aug-16-2018

oh snap. thank you. im still learning!


RE: Printing a new python list - buran - Aug-17-2018

don't use list as variable name, it's build-in function...