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
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
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 Valu
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
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
--
https://mail.python.org/mailman/listinfo/python
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 = int(
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.
>>
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: &qu
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: print(
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, i
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 to
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, wh
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 first
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."
retu
"^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
t
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 w
"^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
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
homew
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 wri
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 num
^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?
--
https://mail.pyt
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 =
"^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( input("Insert
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 number:
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 need
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 a
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)
>
> i
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 is:
-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)
>
> Try
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
30 matches
Mail list logo