0
Iterating by character
hi, how do I go about this # create a program which gets the user input for car. first_name #create an empty string variable: new_name #iterate though letters in first_name #add each letter in new_name #capitalise if letter is an "I" or "o" #print new_name
2 Réponses
+ 1
This is a possible answer using for loop
https://code.sololearn.com/cWZZITXbxiqJ/?ref=app
You can shorten it by directly placing the input function after the "in" keyword in the loop
0
Another way using string methods
https://code.sololearn.com/cCgvxLJBgr4C/?ref=app