Last thing you'll ever read…again
Got 5 Minutes?
So angry at myself for not having enough time to do the last question…for info prac…
Just did it in under 5 minutes…
number = int(raw_input("Enter number:\n"))
base = int(raw_input("Enter Base:\n"))
result = ”
if base >= 2 and base <= 9:
while number >= base:
result = str(number % base) + result
number = number / base
print str(number) + result
base = int(raw_input("Enter Base:\n"))
result = ”
if base >= 2 and base <= 9:
while number >= base:
result = str(number % base) + result
number = number / base
print str(number) + result
*sigh*
On the plus side I managed to get 6 out of 10 for my Maths Quiz. The average was 5… To tell you the truth I was expecting a 3…considering how other people went…but yeah I’m pretty happy with myself. I felt pretty good about the info prac, except I could have made my decimal to binary converter 3 lines shorter cause I wasn’t thinking straight under the pressure…only realised when I got on the train…silly me.
| Print article | This entry was posted by John Jiang on April 18, 2007 at 8:53 pm, and is filed under WCEXO. Follow any responses to this post through RSS 2.0. Both comments and pings are currently closed. |
Comments are closed.
about 3 years ago