Deal of the Day

Home » Main » Manning Forums » 2008 » Hello World!

Thread: Biggest number

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 1 - Pages: 1 - Last Post: Nov 20, 2011 9:49 PM by: carter.sande
Bennjamin


Posts: 27
From: I live near Portland but in Washington.
Registered: 9/18/10
Biggest number
Posted: Nov 20, 2011 5:57 PM
  Click to reply to this thread Reply

I'm making a quiz in python, and i need to figure out what the largest of the 5 variables are. Any suggestions?

carter.sande

Posts: 33
From: Ottawa, Canada
Registered: 1/27/09
Re: Biggest number
Posted: Nov 20, 2011 9:49 PM   in response to: Bennjamin in response to: Bennjamin
  Click to reply to this thread Reply

You could use the max function, like this:

print max(var1, var2, var3, var4, var5)

It will tell you which number is the biggest (or max) of a set of numbers.

Legend
Gold: 300 + pts
Silver: 100 - 299 pts
Bronze: 25 - 99 pts
Manning Author
Manning Staff
Manning Developmental Editor