feat(r-1.3_scratch.py): tried breaking the loop
This commit is contained in:
@@ -12,13 +12,13 @@ that I've created.'
|
|||||||
|
|
||||||
y = True
|
y = True
|
||||||
while y == True:
|
while y == True:
|
||||||
x = input('Enter a number: ')
|
x = input('Enter a number (type "quit" to stop): ')
|
||||||
try:
|
try:
|
||||||
x = float(x)
|
x = float(x)
|
||||||
if x != float(x):
|
if x != float(x):
|
||||||
y = False
|
y = False
|
||||||
except:
|
except:
|
||||||
input('Please enter a number: ')
|
input('Please enter a number: ')
|
||||||
if x == float(x):
|
else:
|
||||||
data = [x]
|
if x == str(quit):
|
||||||
print(data)
|
break
|
||||||
Reference in New Issue
Block a user