0
There's an example code in Python Intermediate course that makes no sense.
https://www.sololearn.com/en/learn/courses/JUMP_LINK__&&__python__&&__JUMP_LINK-intermediate/lesson/2863742757?p=15 It shows the len() function being successfully called on an integer. Any avenue of reporting such issues on PC? I know the phone app has Feedback section.
7 Answers
+ 3
Igor MatiÄ ,
what is the lesson name?
+ 3
Hi, Igor MatiÄ !
Normally, if you pass a number as an argument to the built-in `len` function, it results in a `TypeError`. Does this not occur, or is the error caught and handled in an exception process?
+ 3
Igor MatiÄ
Thanks for pointing the lesson name.
"More on Exception Handling" isn't in my course. Apparently SL updated the course, and the "old learner" has to reset in order to access the "updated course".
There is a feedback function if you click on the humburger menu. You can also send email to info@sololearn.com and report your discovery.
+ 2
Please provide the lesson name.
From the link you posted, it seems it is at page 15. However, I looped through all the lesson and the max page is 8.
Unless SL updated the course...
+ 1
Lothar Wong Hei Ming Per Bratthammar the link works on PC. The lesson is called More on Exception Handling. The exact code writes as:
year_born = 93
"if" len(year_born) != 4:
"raise" "ValueError"
It's one of those examples where learner needs to place correct words into correct fields, which i encased into double quotes (not to be mixed with strings).
+ 1
Hi again Igor MatiÄ,
I couldn't find the exercise; it might have been updated.
However, the code you shared makes sense in a certain context. It seems designed to check if the input, presumed to be a string, has a specific length. For example, if you input your birth year as a four-digit number (e.g., 2001), it should pass; otherwise, it should raise a `ValueError`.
If this behavior isn't reflected in your exercise, you might want to report this discrepancy to SoloLearn.
+ 1
Code for a smart market controlled by voice commands.please