Hi, I’m in the process of teaching myself python. Can someone have a look at the text in red and explain please.
# String exercise 2 print("Quote Formatter") print("This program displays a given quote in different formats") print() # Why is this needed? quote = input("Please enter a quote to format: ") print(quote) print(quote.upper()) print(quote.lower()) print(quote.capitalize()) print(quote.title()) replaceWord = input("Which word in the quote would you like to replace: ") replaceWith = input("Please enter the word to replace with: ") print("The original quote is: {0}".format(quote)) print("The new quote is:{0}".format(quote.replace(replaceWord,replaceWith))) # Not sure what the {0}.format is doing Thanks. Abid
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor