0

How to stop the another 'd' in 'macdonalds' from being capitalized?

I want to capitalize the 1st and 4rth letter of any word that i provide. For eg: 'macdonalds' ---> 'MacDonalds' word= 'macdonalds' For i in word: If i == word[0] or i == word[3]: i = i.upper() Print(i, end= ' ') It prints===> MacDonalDs I can't find a method to stop the another 'D' from being capitalized.. By method i mean something that can tell the program that the letter 'd' is already seen earlier and no need to capitalize the next 'd'..

22nd Jul 2019, 12:57 PM
Amit Dubey
Amit Dubey - avatar
2 Réponses
+ 1
Thanks a lot for solving the problem..😊 i get it now.. devanille
22nd Jul 2019, 2:10 PM
Amit Dubey
Amit Dubey - avatar