feat(r-1.3_scratch.py): found a way to add multiple user inputs to a list
This commit is contained in:
@@ -10,6 +10,7 @@ backwards into the function itself. I need to find a way to end the input loop
|
||||
that I've created.'
|
||||
"""
|
||||
|
||||
data = []
|
||||
y = True
|
||||
while y == True:
|
||||
x = input('Enter a number (type "quit" to stop): ')
|
||||
@@ -20,5 +21,8 @@ while y == True:
|
||||
except:
|
||||
input('Please enter a number: ')
|
||||
else:
|
||||
if x == str(quit):
|
||||
break
|
||||
if x == float(x):
|
||||
data += [x,]
|
||||
print(data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user