feat(r-1.3_scratch.py): found a way to add multiple user inputs to a list

This commit is contained in:
baphim
2026-09-03 01:01:02 -04:00
parent 7f74df6df2
commit fe2ae46053
+6 -2
View File
@@ -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)