Just write something showing you can figure out how to loop over the string. Post it. You'll get no more help until you do. Ever time you post back we want to see what you have tried. If you haven't tried anything new then we are wasting time trying to help you.

Mekire wrote:Just write something showing you can figure out how to loop over the string. Post it. You'll get no more help until you do. Every time you post back we want to see what you have tried. If you haven't tried anything new then we are wasting time trying to help you.

-Mek

I don't know what loop over string means!!!

this is some stuff i was given, looping over characters.

Time to combine some of our skills. We want to use our understanding of strings, the len function and while loops to print out each character of a string, one per line.To do this, we can create an index variable, i and loop from 0 up to (but not including) the length of the string, which we can find using len(s):

but i don't even get what that means and i don't know how to loop over a string, and how to loop over a string to help me in my question..i am really stuck.i don't know much python:

all i know is: -

Print a stringRecognise a syntax errorStore things in variablesRead input from the user

Use mathematical operations (+ - * / **)Use stringsFind the length of a stringConvert between numbers and stringsPrint out numbers and strings

Use the if/elif/else control structureUnderstand the difference between assignment and comparisonMake numerical comparisons using (> < = != >= <=)Use nested if statements

Check for substrings within a stringUse strings in conditional expressions in if statementsChange the case of a stringReplacing parts of a string

Loop over the characters in a stringLoop over a range of numbersPrinting output from a loop on one lineSum numbers using a loop

Understand the difference between floats and integersConvert between floats and integersMaths moduleUse slicing to extract a substring from a stringString methods: startswith, endswith, strip

Looping while something is true: while loopsUsing counters to step in loopsInfinite loopsReading multiple lines from the userLooping over charactersFactorisation: worked example

Access and modify elements in a listSort and reverse a listCreate a list to store multiple valuesLoop while a condition is trueUse while loops to loop over a range of numbersIdentify an infinite loopUse a while loop to read input from the user

In every language I've used that uses loops extensively (instead of recursion, such as Lisp or Prolog), for loops are preferable to while loops. Python just shows off how great ours are with itertools.

el_manu: are you doing this for a class, or for yourself? If it's for a class, you need to seek an in person tutor who has plenty of time to figure things out with you. If you're doing it for yourself, read tutorials, watch Youtube videos, or whatever helps you learn to form a basis, because that's not something we should be doing for you. (Tutorials and Youtube videos can also help even if you're taking a class, but if you're on a time schedule I do recommend one-on-one help on top of those.)

Join the #python-forum IRC channel on irc.freenode.net!

Please do not PM members regarding questions which are meant to be discussed publicly. The point of the forum is so that others can benefit from it. We don't want to help you over PMs or emails.

i am sure by now you guys are like....who is this el_manu guy. GIVE this guy a MANUAL. so i will make a last deal. if someone actually gives me the answer to this question, I will not bother the forums with any other questions or posts and you won't here of el_manu again until i actually READ A MANUAL.

please i really need it. i need it badly. who cares about the rest of the questions i NEED this one.

a = input("Music? ")b = a.upper()if "H" or "I" or "J" or "K" or "L" or "M" or "O" or "P" or "Q" or "R" or "S" or "T" or "U" or "V" or "W" or "X" or "Y" or "Z" in b: print("That's not music!")else: print("That's music!")

i have all my notes and stuff from my tutor and stuff, but i don't really get the for loops. so looping through this and do that is like chinese. i have taken codeacademy.com and countless other websites as well as reading book but is STILL DON't GET what FOR LOOPS DO AND ARE AND HOW TO USE THEM FOR THIS QUESTION.............i am frustrated because you are trying to help and giving good advice are but I am that dumb that I am beyond help and it is making me retarted.

a = input("Music? ")b = a.upper()if "H" in b or "I" in b or "J" in b or "K" in b or "L" in b or "M" in b or "N" in b or "O" in b or "P" in b or "Q" in b or "R" in b or "S" in b or "T" in b or "U" in b or "V" in b or "W" in b or "X" in b or "Y" in b or "Z" in b: print("That's not music!")else: print("That's music!")