Writing the number 1 gives me a SyntaxError

So I recently started on Codecademy and i noticed that whenever i have to use the number “1” in a code, i get a Syntax error. The context of when this happens doesn’t seem to matter. If i copy the “1” from the description or anywhere else on the site, it works fine.

Anyone with the same issue?

I use a swiss keyboard and the Chrome browser if that matters.

Thanks a lot in advance for every bit of help!

Anything in quotation marks is interpreted as a str object, not a number. Number primitives (like boolean) are written without quotes.

a = 1
type(a)    //  int
a = '1'
type(a)    //  str

Thanks for the answer, i should’ve written this differently.
The number is actually not in quotation marks, I only made that hoping it would make the question clearer (which apparently it didn’t). So an example would be an exercise in which I have to define a function that takes 1st as an input:

def example(1st):
 

this would give me a Syntax error for the number 1.
However, if i copy 1st from the instructions on the left side, it works just fine.
It seems like the 1 i type on my keyboard is a different input as the 1 used by codecademy or python.
I hope this is understandable, English isn’t my first language.

1 Like

Variable names may not begin with a number character. That 1 should be a lowercase l.

2 Likes

THIS IS IT! Thank you so, so much for the quick and helpful answer. Can’t believe i was too stupid to notice that.
Keep at it, you’re amazing!

2 Likes

Just so you know, ‘stupid’ is not a word in a programmer’s lexicon. You’re here to learn. That’s not stupid. It’s smart. We all make mistakes, repeatedly, and relish in it. Join the club.

5 Likes

Agreed!

Plus if it makes you feel any better, when I first started I spent about half an hour trying to figure out the l is a lower case L.

1 Like

Wow, those were some well-chosen words. If no one has told you this yet today, you’re a gift to humanity! Thank you so much for helping people, even with simple problems like mine.
I decided that I want my future to be in IT and when I started to learn python as my entry into programming; I was overwhelmed by how much it is to learn. However, hearing what you just said gives me hope and courage. i know this might sound cheesy, but I really don’t take this for granted!

have a lovely weekend!

1 Like