about | help | code help+videos | done | prefs |
Define a function that when passed an integer and the required number of least-significant digits, returns a number containing the required value. You can use math.pow(10, x) to get the required power of 10, because, without that, you'll need loops to solve this one. last_digits(1729, 3) → 729 last_digits(1729, 10) → 1729 last_digits(92716174, 6) → 716174 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 1 Post-solution available
Copyright Nick Parlante 2017 - privacy