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.'
|
that I've created.'
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
data = []
|
||||||
y = True
|
y = True
|
||||||
while y == True:
|
while y == True:
|
||||||
x = input('Enter a number (type "quit" to stop): ')
|
x = input('Enter a number (type "quit" to stop): ')
|
||||||
@@ -20,5 +21,8 @@ while y == True:
|
|||||||
except:
|
except:
|
||||||
input('Please enter a number: ')
|
input('Please enter a number: ')
|
||||||
else:
|
else:
|
||||||
if x == str(quit):
|
if x == float(x):
|
||||||
break
|
data += [x,]
|
||||||
|
print(data)
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user