Python Forum

Full Version: Help naming functions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
For my assignment, it says to "create a string called Q1 with a word, and then create a function called Q2 that loops through and prints each character in Q1."

I can label Q1 and have it run correctly. I can make my next section loop through and prints each character in Q1, but I can't label it "Q2" without it messing up.

I have attached an image of what I have done that works and then naming it and messing it up.

My apologies for my terminology. I've only been at this for about 2 days lol.

I appreciate anything in advance! I'm sure it's something easy that I'm missing. [attachment=2613]
Q2(). To call a function you follow the function name with parenthesis. Just like you did with print().