[Tutor] uplownumpnct.py
ThreeBlindQuarks
threesomequarks at proton.me
Fri Dec 29 21:54:40 EST 2023
Ethan,
Regular thanks expressed does not get you answers.
Taking a bit more time to explain what your code is supposed to do would be more helpful. As others keep asking, since we can not actually run the code with so many mistakes, you should copy a transcript of the code running, perhaps a line or two at a time, so we can see where the rror messages pop up.
Others have noted code you are not using, at least not yet, and that can safely be removed when you show a sample that generates the erros.
But what we do NOT see is whether you initialized the variable you call "letter" and if so, to what.
When I set letter to a single character, it sort of works:
>>> letter='e'
>>> if letter in sent:
... x=letter.isupper()
...
>>> x
False
But why you are checking if it is upper case is not stated.
But why is there a colon at the end of that line?
And why is the rest of the code indented deeper and why are you comparing a True/False value to 1? I mean, it sort of works as like some languages, True and 1 both evaluate to Truthy.
There are many possible errors above and perhaps even higher up in the code you may not be showing. Python will normally show an error near where it catches it. Many syntax errors are possible.
Until and unless you can show us better, perhaps it is best if others work with you and perhaps even someone local who can look over your shoulder.
Good Luck.
Sent with Proton Mail secure email.
On Friday, December 29th, 2023 at 3:43 PM, Ethan Rosenberg <ethanrosenberg414 at gmail.com> wrote:
> Tutor -
>
> Thank you for the wonderful help you provide to Python programmers!!
>
> What is syntax error?
>
> sent = 'THIS is the way we wash 1 2 3 , , !'
>
> lgn = len(sent)
> lgn2 = lgn
> if letter in sent:
> x=letter.isupper():
> if x = 1:
> print('wow!')
>
> Ethan Rosenberg
> _______________________________________________
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
More information about the Tutor
mailing list