Tom's Hardware > Forum > Applications > Programming > Python- please help!

Python- please help!

Forum Applications : Programming - Python- please help!

Tom's Hardware: Over 1.4 million members in 6 different countries available to answer all your high-tech questions. Sign up now! Its free!
Word :    Username :           
 

Hey guys

I've been learning Python lately, but I wanted to see if anyone could help me out with coming up with a code. basically, I want it to be able to calculate the mode and median of a set of numbers (that would be a raw_input- so variables). But without using library functions. It would be awesome if anyone could help me out!

If anyone has any ideas, please let me know! I'm lost on this one!! I really appreciate it, thanks in advanced!

I did come up with this however for the average if anyone cares (that was an easy one for me to figure out, heh)

total = 0.0
count = 0
while count < 3:
number=float(raw_input("Enter a number: " ))
count = count + 1
total = total + number
average = total / 3
print "The average is " + str(average)

Cheers
DV

Sponsored Links
Register or log in to remove.

The whole point of Python is to use the supplied library functions.

Python isn't complied dude, it's interpreted (or included within an EXE/BIN which just interprets it, and makes it 'look' and 'act' like a traditional compiled binary).

There is also CPython, which can 'compile' it into bytecode, similar to Java.

You may also want to check out:
http://en.wikipedia.org/wiki/Unladen_Swallow
http://en.wikipedia.org/wiki/Microthread


Which library functions are you trying to avoid using ?

------------------------------ Averaging 7 points per post, since err, I re-joined this mess.
Reply to Scott2009
Tom's Hardware > Forum > Applications > Programming > Python- please help!
Go to:

There are 532 identified and unidentified users. To see the list of identified users, Click here.

Sponsored links
  • Ask the community now
  • Publish
Ad
They won a badge
Join us in greeting them