From 5dc786d9f915c4879a516b2edb4fdae37e028af0 Mon Sep 17 00:00:00 2001 From: baphim <269010393+baphim@users.noreply.github.com> Date: Thu, 3 Sep 2026 23:10:08 -0400 Subject: [PATCH] fix(r-1.3_scratch.py): problem solved: syntax error --- lab-01/r-1.3_scratch.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lab-01/r-1.3_scratch.py b/lab-01/r-1.3_scratch.py index 034fc93..9427c69 100644 --- a/lab-01/r-1.3_scratch.py +++ b/lab-01/r-1.3_scratch.py @@ -4,10 +4,11 @@ Created on Wed Sep 2 22:49:38 2026 @author: joseph -- I figured out the function after some rest. Now I want to sort out an input -method that allows for any number of floats. I'm trying to remember without -looking at git history, the input verification loop I had yesterday, but I'd -have to append converted strings to a var.' +- The validation loop (which I just learned was called a try-except structure) +is printing every correctly formatted float as an invalid number. After digging +around with Spyder, I found PyLint code analysis, ran that, and found my syntax +error: having the colon directly after except on line 27 instead of after the +entire line. """ def minmax(*data): @@ -23,8 +24,7 @@ float_data = [] for x in list_data: try: float_data.append(float(x)) - except:ValueError - print(f'{x} is an invalid number') - + except ValueError: + print(f'{x} is an invalid number') + print(float_data) - \ No newline at end of file