Kodewick
Start learning →
Starter←→0 / 100

Lucky last digit

#081StarterNumbers2 min

The mall raffle goes by the last digit of your receipt number. Write last_digit(n) to return the ones digit of n (n is 0 or a positive whole number).

Examples
last_digit(2048)→8
last_digit(70)→0
main.py
def last_digit(n):
    # your code here: the remainder of n divided by 10
    pass
Ctrl + Enter runs too
Result

Run tries the examples. When they look right, Submit.