Chapter 3.2 - Multiple cases in IF

3.2 - Multiple cases in if command

What is and inside the if command? and means that in order for the statement to be true both statements should be true.

print ("Check Up") weight = int(input("Insert your weight in kilos : ")) height = int(input("Insert your height in centimeters : ")) if weight >=100 and height <= 170: print ("You might consider to lose some weight") elif weight<= 50 and height > 175: print ("I think that you are very skinny") else: print ("You are just about right")


What is or inside the if command? or means that in order for the statement to be true one or both statements should be true.

print ("I know my friends") name = input("Please write your name : ") if name == "John" or name == "Jim" or name == "Justin": print ("Hello my friend", name) else: print ("Do you want to be my friend", name, "?")


In the programs above think which are the variables and what type are these variables.

We have now a new problem for you.

We want to create a program that asks for three numbers and then displays the greatest. 

As an example when we execute the program the output could be :

Hello! Please insert three different integer numbers and i will find the greatest.
The first number is :  13
The second number is :  19
The third number is :  8
Great! The greatest number of 13,19,8  is  19.

You can find a solution here