fix(r-1.3_scratch.py): problem solved: syntax error

This commit is contained in:
baphim
2026-09-03 23:10:08 -04:00
parent 15b26e2e2b
commit 5dc786d9f9
+7 -7
View File
@@ -4,10 +4,11 @@
Created on Wed Sep 2 22:49:38 2026 Created on Wed Sep 2 22:49:38 2026
@author: joseph @author: joseph
- I figured out the function after some rest. Now I want to sort out an input - The validation loop (which I just learned was called a try-except structure)
method that allows for any number of floats. I'm trying to remember without is printing every correctly formatted float as an invalid number. After digging
looking at git history, the input verification loop I had yesterday, but I'd around with Spyder, I found PyLint code analysis, ran that, and found my syntax
have to append converted strings to a var.' error: having the colon directly after except on line 27 instead of after the
entire line.
""" """
def minmax(*data): def minmax(*data):
@@ -23,8 +24,7 @@ float_data = []
for x in list_data: for x in list_data:
try: try:
float_data.append(float(x)) float_data.append(float(x))
except:ValueError except ValueError:
print(f'{x} is an invalid number') print(f'{x} is an invalid number')
print(float_data) print(float_data)