Python Forum
Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
While loops
#5
(Sep-21-2017, 03:15 AM)ralfi Wrote:
List = ["1","2","3","5" ]
while True:
print("hello")
number = (int(input("give me a number? ")
         ^   ^     ^                    ^

 You open three parenthesis, but only close one of them. A statement is illegal inside of parentheses, which is why you get a syntax error pointing at the if statement you try to include inside the parentheses.
Reply


Messages In This Thread
While loops - by ralfi - Sep-21-2017, 02:11 AM
RE: While loops - by Lux - Sep-21-2017, 02:17 AM
RE: While loops - by ralfi - Sep-21-2017, 03:15 AM
RE: While loops - by nilamo - Sep-22-2017, 05:34 PM
RE: While loops - by ichabod801 - Sep-21-2017, 04:09 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020