Re: Exercize to understand from three numbers which is more high

2019-01-29 Thread Ian Clark
d not possibly be run in a Python interpreter, I think. >> >> --- Joseph S. >> >> From: Adrian Ordona >> Sent: Tuesday, January 29, 2019 2:52 PM >> To: Schachner, Joseph >> Cc: Dan Sommers <2qdxy4rzwzuui...@potatochowder.com>; >> python-list@python.org >&g

Re: Exercize to understand from three numbers which is more high

2019-01-29 Thread Ian Clark
sibly be run in a Python interpreter, I think. > > --- Joseph S. > > From: Adrian Ordona > Sent: Tuesday, January 29, 2019 2:52 PM > To: Schachner, Joseph > Cc: Dan Sommers <2qdxy4rzwzuui...@potatochowder.com>; > python-list@python.org > Subject: Re: Exercize to und

Re: Exercize to understand from three numbers which is more high

2019-01-29 Thread Ian Clark
threw this together, let me know what you think num_list=[] name_list = ['first','second','third','fourth','fifth','sixth','seventh','eighth','ninth','tenth'] name_it = name_list.pop(0) while len(num_list) < 3: try: num_list.append( int( input(f"Insert the {name_it} number: "))) except

Re: Exercize to understand from three numbers which is more high

2019-01-29 Thread Ian Clark
Like this? num_max = 0 num_index = 0 name_list = ['first','second','third','fourth','fifth','sixth','seventh','eighth','ninth','tenth'] name_it = name_list.pop(0) while num_index <3: try: num_list = int( input(f"Insert the {name_it} number: ")) except ValueError: print('Not a number, try

Re: Exercize to understand from three numbers which is more high

2019-01-29 Thread Chris Angelico
On Wed, Jan 30, 2019 at 8:20 AM Bob van der Poel wrote: > Isn't the easiest way to do this is: > > sorted( [n1,n2,n3] )[-1] > > to get the largest value? >>> help(max) But the point of this exercise is not to use sorted() or max(). ChrisA --

Re: Exercize to understand from three numbers which is more high

2019-01-29 Thread Bob van der Poel
On Tue, Jan 29, 2019 at 12:52 PM Adrian Ordona wrote: > i'm also a beginner reading all the replies helps. > i was trying the problem myself and came up with the below code with a > users input. > > > num1 = int(input("Enter first number: "))num2 = int(input("Enter second > number: "))num3 =

Re: Exercize to understand from three numbers which is more high

2019-01-29 Thread Adrian Ordona
9 2:52 PM >> To: Schachner, Joseph >> Cc: Dan Sommers <2qdxy4rzwzuui...@potatochowder.com>; python-list@python.org >> Subject: Re: Exercize to understand from three numbers which is more high >> >> i'm also a beginner reading all the replies helps. >> i wa

RE: Exercize to understand from three numbers which is more high

2019-01-29 Thread Schachner, Joseph
com>; python-list@python.org Subject: Re: Exercize to understand from three numbers which is more high i'm also a beginner reading all the replies helps. i was trying the problem myself and came up with the below code with a users input. num1 = int(input("Enter first number: "))

Re: Exercize to understand from three numbers which is more high

2019-01-29 Thread Adrian Ordona
i'm also a beginner reading all the replies helps. i was trying the problem myself and came up with the below code with a users input. num1 = int(input("Enter first number: "))num2 = int(input("Enter second number: "))num3 = int(input("Enter third number: "))if num1 > num2 and num1 > num3:

RE: Exercize to understand from three numbers which is more high

2019-01-29 Thread Schachner, Joseph
Explanation: 5 > 4 so it goes into the first if. 5 is not greater than 6, so it does not assign N1 to MaxNum. The elif (because of the lack of indent) applies to the first if, so nothing further is executed. Nothing has been assigned to MaxNum, so that variable does not exist. You're right,

Re: Exercize to understand from three numbers which is more high

2019-01-29 Thread MRAB
On 2019-01-29 16:02, Dan Sommers wrote: On 1/29/19 9:27 AM, Jack Dangler wrote: wow. Seems like a lot going on. You have 3 ints and need to determine the max? Doesn't this work? N1, N2, N3 if N1>N2   if N1>N3     MaxNum = N1 elif N2>N3   MaxNum = N2 elif N1 No. Assuing that you meant

Re: Exercize to understand from three numbers which is more high

2019-01-29 Thread Dan Sommers
On 1/29/19 9:27 AM, Jack Dangler wrote: wow. Seems like a lot going on. You have 3 ints and need to determine the max? Doesn't this work? N1, N2, N3 if N1>N2   if N1>N3     MaxNum = N1 elif N2>N3   MaxNum = N2 elif N1 No. Assuing that you meant to include colons where I think you did,

Re: Exercize to understand from three numbers which is more high

2019-01-29 Thread Jack Dangler
On 1/27/19 7:34 AM, Frank Millman wrote: "^Bart" wrote in message news:q2k1kk$1anf$1...@gioia.aioe.org... >    You need to do this exercize just by using if, elif and else, >    but in the quotation above, you use "=". We can use > < and = Now I wrote: number1 = int( input("Insert the

Re: Exercize to understand from three numbers which is more high

2019-01-29 Thread Jack Dangler
On 1/27/19 5:19 AM, ^Bart wrote: In my experience based on decades of writing programs... 1. The assignment/exercise/problem should be a write a function with a particular signature.  So first decide on the signature. def max3(n1, n2, n3): "Return the max of the three inputs."

Re: Exercize to understand from three numbers which is more high

2019-01-28 Thread Frank Millman
"^Bart" wrote in message news:q2mghh$ah6$1...@gioia.aioe.org... > 1. The last two lines appear to be indented under the 'if number3 < ' > line. I think you want them to be unindented so that they run every > time. I'm sorry but I didn't completely understand what you wrote about the last

Re: Exercize to understand from three numbers which is more high

2019-01-28 Thread ^Bart
Excellent! Glad I could help. Thank you! :) I'm studying Python everyday and I try to do the best! :) 1. The last two lines appear to be indented under the 'if number3 < ' line. I think you want them to be unindented so that they run every time. I'm sorry but I didn't completely understand

Re: Exercize to understand from three numbers which is more high

2019-01-27 Thread Frank Millman
"^Bart" wrote in message news:q2kh0t$1hnj$1...@gioia.aioe.org... > You have got to a starting point - you have three numbers. Good. > > Where do you do go from here? > > I would start with two of the numbers, and work out which one is higher. # SOLVED!!! number1 = int( input("Insert the first

Re: Exercize to understand from three numbers which is more high

2019-01-27 Thread ^Bart
as a follow on exercise if you have covered them yet, convert your code into a function takes the 3 numbers as parameters. you will find as you progress it is a better way of structuring your program & increases flexibility. Next step will be to study functions and I'll have other kind of

Re: Exercize to understand from three numbers which is more high

2019-01-27 Thread ^Bart
Hm, what does your script print if there are equal numbers? Insert the first number: 5 Insert the second number: 6 Insert the third number: 5 Number max is: 6 Number middle is: 5 >>> The exercize was made to improve the use of if with three different conditions, maybe it could be nice to

Re: Exercize to understand from three numbers which is more high

2019-01-27 Thread Alister via Python-list
On Sun, 27 Jan 2019 15:59:42 +0100, ^Bart wrote: >> You have got to a starting point - you have three numbers. Good. >> >> Where do you do go from here? >> >> I would start with two of the numbers, and work out which one is >> higher. > > # SOLVED!!! > number1 = int( input("Insert the first

Re: Exercize to understand from three numbers which is more high

2019-01-27 Thread Peter Otten
^Bart wrote: >> You have got to a starting point - you have three numbers. Good. >> >> Where do you do go from here? >> >> I would start with two of the numbers, and work out which one is higher. > > # SOLVED!!! Hm, what does your script print if there are equal numbers? --

Re: Exercize to understand from three numbers which is more high

2019-01-27 Thread ^Bart
You have got to a starting point - you have three numbers. Good. Where do you do go from here? I would start with two of the numbers, and work out which one is higher. # SOLVED!!! number1 = int( input("Insert the first number: ")) number2 = int( input("Insert the second number: ")) number3

Re: Exercize to understand from three numbers which is more high

2019-01-27 Thread Frank Millman
"^Bart" wrote in message news:q2k1kk$1anf$1...@gioia.aioe.org... >You need to do this exercize just by using if, elif and else, >but in the quotation above, you use "=". We can use > < and = Now I wrote: number1 = int( input("Insert the first number: ")) number2 = int(

Re: Exercize to understand from three numbers which is more high

2019-01-27 Thread ^Bart
You need to do this exercize just by using if, elif and else, but in the quotation above, you use "=". We can use > < and = Now I wrote: number1 = int( input("Insert the first number: ")) number2 = int( input("Insert the second number: ")) number3 = int( input("Insert the third

Re: Exercize to understand from three numbers which is more high

2019-01-27 Thread ^Bart
In my experience based on decades of writing programs... 1. The assignment/exercise/problem should be a write a function with a particular signature.  So first decide on the signature. def max3(n1, n2, n3):     "Return the max of the three inputs."     return None  # To be replaced. I

Re: Exercize to understand from three numbers which is more high

2019-01-25 Thread Terry Reedy
On 1/25/2019 6:56 AM, ^Bart wrote: number1 = int( input("Insert the first number: ")) number2 = int( input("Insert the second number: ")) number3 = int( input("Insert the third number: ")) if number1 > number2 and number1 > number3:     print("Max number is: ",number1) if number2 > number1

Re: Exercize to understand from three numbers which is more high

2019-01-25 Thread Bob Gailer
On Jan 25, 2019 7:00 AM, "^Bart" wrote: > > number1 = int( input("Insert the first number: ")) > > number2 = int( input("Insert the second number: ")) > > number3 = int( input("Insert the third number: ")) > > if number1 > number2 and number1 > number3: > print("Max number is: ",number1) > >

Re: Exercize to understand from three numbers which is more high

2019-01-25 Thread Joel Goldstick
On Fri, Jan 25, 2019 at 7:16 AM Dan Purgert wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA256 > > ^Bart wrote: > > > > if number1 > number2 and number1 > number3: > > print("Max number is: ",number1) > > > > if number2 > number1 and number2 > number3: > > print("Max number

Re: Exercize to understand from three numbers which is more high

2019-01-25 Thread Dan Purgert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 ^Bart wrote: > > if number1 > number2 and number1 > number3: > print("Max number is: ",number1) > > if number2 > number1 and number2 > number3: > print("Max number is: ",number2) > > else: > print("Max number is: ",number3) > >

Exercize to understand from three numbers which is more high

2019-01-25 Thread ^Bart
number1 = int( input("Insert the first number: ")) number2 = int( input("Insert the second number: ")) number3 = int( input("Insert the third number: ")) if number1 > number2 and number1 > number3: print("Max number is: ",number1) if number2 > number1 and number2 > number3: print("Max