Hi can i get answer of the given question please
Pythonize is a new language, that is similar to English, however
the first letter of each word in Pythonize is moved to the end.
Furthermore, each word in this new language ends with ‘py’. Write a
program that takes an English word as an input and prints the
Pythonize equivalent on the screen. (Save your script as
pythonize.py and pythonize.txt)
For example:
If the input is: "Python"
The output would be: Ythonppy
word = input("Enter a word: ") # read a word from user # let's assume word is Python # word[1:] gives ython # word[0] gives P # so, word[1:] + word[0] + "py" gives ypthonPpy # then capitalize function converts first letter to uppercase and all other letters to lowercase # so, (word[1:] + word[0] + "py").capitalize() gives Ythonppy python_word = (word[1:] + word[0] + "py").capitalize() print(python_word) # print python word
Python Ythonppy Process finished with exit code 0
Please let me know if you have any doubts Please upvote this answer. Thanks!!
Get Answers For Free
Most questions answered within 1 hours.