- #1
mockingbird
- 3
- 0
I Have been using A Byte of Python, and I am now stuck on the Continue Statement. Here is my code.
#!/usr/bin/python
#Filename: continue1.py
while True:
s = input('Enter something : ')
if s == 'quit':
break
if len(s) < 3:
print('Too Small')
continue
print('Input is of sufficient Length')
#Do other kinds of Processing here...
I keep getting this...
andrew@andrew-laptop:~$ python continue1.py
Enter something : a
Traceback (most recent call last):
File "continue1.py", line 5, in <module>
s = input('Enter something : ')
File "<string>", line 1, in <module>
NameError: name 'a' is not defined
I am completely new at this, but I have 1. Spent more than two hours trying to figure this out. 2. Looked online for longer than an hour to find an example of what I have done wrong. 3. Stared at this problem until my eyes have bled.
I hope someone can/will help me figure this out. I am using gedit that came with my version of Ubuntu. I don't know if that will change anything.
#!/usr/bin/python
#Filename: continue1.py
while True:
s = input('Enter something : ')
if s == 'quit':
break
if len(s) < 3:
print('Too Small')
continue
print('Input is of sufficient Length')
#Do other kinds of Processing here...
I keep getting this...
andrew@andrew-laptop:~$ python continue1.py
Enter something : a
Traceback (most recent call last):
File "continue1.py", line 5, in <module>
s = input('Enter something : ')
File "<string>", line 1, in <module>
NameError: name 'a' is not defined
I am completely new at this, but I have 1. Spent more than two hours trying to figure this out. 2. Looked online for longer than an hour to find an example of what I have done wrong. 3. Stared at this problem until my eyes have bled.
I hope someone can/will help me figure this out. I am using gedit that came with my version of Ubuntu. I don't know if that will change anything.