2011-03-04, 06:09 PM
I'm converting a string to an integer value. That was what I was taught, so I dunno. If input() will allow me to get an immediate integer value, I'll keep that in mind. If you have the time to give me a little extra advice to shorten the code, I'd be happy to receive that. But I'm mostly just looking for a confirmation (since it's due today lolol).
For above code:
You can use (if word[0].lower in (insert your conditions here)
to shorten up the line.
From what I understand, you're looking to continue the search through the entire string. If that's the case, you need to set up the string index as a variable which will add onto itself in a loop. Ex. Index = index + 1 -> word[index] So this will go through the entire string each letter at a time.
But since this site is full of python pros, I think I'll just leave it for those guys to give you an even shorter method.
For above code:
You can use (if word[0].lower in (insert your conditions here)
to shorten up the line.From what I understand, you're looking to continue the search through the entire string. If that's the case, you need to set up the string index as a variable which will add onto itself in a loop. Ex. Index = index + 1 -> word[index] So this will go through the entire string each letter at a time.
But since this site is full of python pros, I think I'll just leave it for those guys to give you an even shorter method.

