Translate to Traditional Chinese (δΈ­ζ–‡):

<< Prev   🏠 A B C D E F G Next >>


E.py - Get Last Digit

Write a Python program that asks the user to enter an integer num and then extracts the last digit of the number. Display the result on the screen as the example bellow.
Hint: The last digit of a number can be extracted by taking the modulus (%) of the number with 10


Example 1:
Enter a number: 1234
Last digit: 4

Example 2:
Enter a number: 54328
Last digit: 8


<< Prev   🏠 A B C D E F G    Next >>