help please

pleas could you help please ive just started to learn python and im having trouble with this short program using the if else commands would you be so kind as to look at the code and tell me where im going wrong as im working through a python book and its a program in there the code is:

names = ["fred", "goerge", "harry", "julie", "chris", "barry"]
for birthday in names:
print(birthday)
if names == "harry":
else:
print(names.upper())

this is what happens when i run it:

else:
^
IndentationError: expected an indented block

(deleted)

already have googled it and this is a programming Questions forum and i asked a programming Question so yes this is relevant

Read the forum guidelines for best chance of a useful response. Your thread title is poor, in fact an example of poor contained in the aforementioned guidelines. You have not used code tags and you have not explained your problem. You can edit your post to include the tags and then add a new post with the information anyone would need to help you.

Also, look at the section Hierarchy above: Arduino forum-using arduino-programming questions

im trying to follow the exmple in a book and i copied it as in the book and i end up getting a syntax error on the else statment as you can see when i run it and ive googled it and its written down the same i just cant see where im going wrong i would apprecieate some help thanks

(deleted)

im sorry for any mis-spelling please if you could help it would be helpful.

[names = ["fred", "goerge", "harry", "julie", "chris", "barry"]
for birthday in names:
    print(birthday)
if names == "harry": 
else:
    print(names.upper())/code]

please could tell me where im going wrong with the if else statment. thankyou

No curly brackets!

thanks

chrislittler:
already have googled it and this is a programming Questions forum and i asked a programming Question so yes this is relevant

But this is an Arduino forum and the Arduino does not run Python, or at least you cannot program an Arduino in Python using the Arduino IDE

spycatcher2k may have been a little blunt with her advice but you will get a lot more help in a Python programming forum

Sometimes people are trying to connect an Arduino with a Python app on a PC. That's different. We don't mind helping with that occasionally. But this one really has nothing at all to do with Arduino anything.

Also it's not just a "programming questions" forum. It's a "Using Arduino> Programming Questions" forum.

thanks for your time and im sorry i know its an arduino forum but 99% of people are helpful like yourselves and then thers the 1% so thanks for your time

S2k's posts removed as inflammatory.

Try python.org community

thankyou very much the reason im learning python is so that i can move onto c++ and to use arduino as ive got exsperiance at z80 assembly laungage so thankyo for your time

Assembly to Python to C++ is an interesting trajectory. Personally, I would just go straight to C++ if that's your goal, but certainly learning Python is a useful thing.

There are actually options for programming microcontrollers, even some of the Arduino boards, with Python (the MicroPython and CircuitPython projects), but that is not something the Arduino organization has involved themselves in much so far (though we do have a Google Summer of Code student working on an Arduino Language to Python transpiler project right now) and I also don't see it discussed very often here on the forum. So you will get a lot more assistance here with Arduino Language/C++ code.

(deleted)

no proplem i understand that but thanks for answering my quistion and your time