id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

gaurav1780@gmail.com 02_conditions > rounded_off
prev  |  next  |  chance

In an imaginary economy, all amounts get rounded off to the nearest multiple of 100. Define a function that when passed an integer representing an amount, returns the rounded-off amount. Note: Brownie points if you do it without any condition :)


rounded_off(199) → 200
rounded_off(150) → 200
rounded_off(149) → 100

...Save, Compile, Run (ctrl-enter)

def rounded_off(n):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Difficulty: 3 Post-solution available

Copyright Nick Parlante 2017 - privacy