← Back to challenges

Hidden Calculator Words

PythonHardnumbersstringsloops

Instructions

At school, we used to play with our calculators and send each other secret messages. The trick was to enter a special number and turn the calculator upside-down. LOL ... I mean 707!

Given a number, create a function that converts it into a word by turning the integer 180 degrees around.

Examples

turn_calc(707) ➞ "LOL"

turn_calc(5508) ➞ "BOSS"

turn_calc(3045) ➞ "SHOE"
numberletter
1I
2Z
3E
4H
5S
6G
7L
8B
9-
0O

Notes

  • Convert to uppercase words.
  • Ignore dots.
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.