Welcome to Westonci.ca, your go-to destination for finding answers to all your questions. Join our expert community today! Get quick and reliable answers to your questions from a dedicated community of professionals on our platform. Join our Q&A platform to connect with experts dedicated to providing accurate answers to your questions in various fields.

grade 10 python exercise
Write a program that prints, as a word, the value of the last digit of the int variable number. For example, if the value of number is 547, the fragment should print:
The last digit of 547 is seven


Sagot :

number = 547

nums = {1:"one", 2:"two",3:"three",4:"four",5:"five",6:"six",7:"seven",8:"eight",9:"nine"}

print("The last digit of",number,"is",nums[number%10])

I wrote my code in python 3.8. I hope this helps.

Thanks for using our service. We aim to provide the most accurate answers for all your queries. Visit us again for more insights. Thank you for visiting. Our goal is to provide the most accurate answers for all your informational needs. Come back soon. Find reliable answers at Westonci.ca. Visit us again for the latest updates and expert advice.