Skip to content

Instantly share code, notes, and snippets.

View joshourisman's full-sized avatar

Josh Ourisman joshourisman

View GitHub Profile
@joshourisman
joshourisman / gist:1918906
Created February 26, 2012 20:45 — forked from gsiegman/gist:1918836
Rounding with string homework
#Given a variable, x, that stores
#the value of any decimal number,
#write Python code that prints out
#the nearest whole number to x.
#You can assume x is not negative.
# x = 3.14159 -> 3 (not 3.0)
# x = 27.63 -> 28 (not 28.0)
# Copyright (c) 2008, Ryan Witt
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.