Python idle help


I need help with some python idle code.

basically i have a list and I am trying to print out each letter alternating like a b c a b c

Count is just counting what letter I’m on with numbers.

Every time I try to run the program it gives me an error on the print line

I’m not too good at idle and python so please help!


Ok, so you’re saying that you’re trying to make letters pattern in order? If so, I can’t help, maybe find a tutorial.

1 Like

This is the correct way:

alist = [“1”, “2”, “3”]
count = 0
for x in range(3):
print(alist [0 + count])
count = count + 1

Python lesson: if you see the name of your list/variable/etc in purple (in this type of theme), it is a keyword. Do not use them.
You can see all the keywords in your Python version by typing in the shell (without the ">>>)
">>> import keyword
">>> print(keyword.kwlist)

If you have more questions, I have a programming topic if you want to check out!


No. That double equal was alright.
The problem was that he was using a keyword as a name, which “confuses" the code and the IDLE interprets it as something else.



Yeah I don’t really remember anything I learned about python.


I also forget some Python things (like tuples) XD

Really? My code editor always highlights that as an error.

Also, @RobotPro,

count = count + 1

Could be changed to

count += 1

Just to keep things more short.


In his case, the error was at line 6 bc of the Keyword.

1 Like

You could also change that. But I like to keep it like that:

That is more of a personal choosing bc it doesn’t alter the code XD


Yes, it was just a suggestion. In the end, it’s down to personal preference.

1 Like

Note to self
try solutions later (once your math homework is finished you nugget)


Thank you for the help! When I run your code however it doesn’t exactly give me what I want

I’m trying to make the code alternate between a b c 100 times.

I’m getting an error after the system prints a b c

Which doesn’t make much sense to me because the line of code that has the issue is line 6 which works for three rounds and then stops working.

Thank you for the help though on the alist things. I didn’t know there were keywords not to use in python!


Sorry for the late reply, but could you post your current code (after the corrections). I will try to help you! :slight_smile:


Me too! (I just saw this topic again XD)

1 Like

You’re welcome! Keywords are important :slight_smile:

1 Like

@William04GamerA @LunaMorgana387

Yes! Sorry also about the late reply. I will post the code as soon as possible!


Ok! We are here to help!

1 Like

Me too. I’m here! :slight_smile:

1 Like

now I’m having trouble finding the right program because of the names lol

found it the program was in moop