[Solved] Python & Strings/Loops help please [closed]


1- Using while loop

i = len(full_name.split()) - 1
while(i >= 0):
    print full_name.split()[i]
    i = i-1

2- Slicing

x = full_name.index(" ")
new_string = full_name[x+1:] + " " + full_name[0:x]
print new_string

3- Counting lower and upper

lower = 0
upper = 0
for letter in full_name:
    if letter.islower():
        lower = lower + 1
    elif letter.isupper():
        upper = upper + 1
print "number of lower letters = %s" % lower 
print "number of upper letters = %s" % upper 

4- correcting the sentence

bad_string = "You have to be vewy, vewy twicky to twap a wascally wabbit"
correct_string = bad_string.replace('w', 'r')
print correct_string

2

solved Python & Strings/Loops help please [closed]