Edhesive 3.2 code Practice:Question 1

Write a program to a number and test if it is greater than 45.6. If the number entered is greater than 45.6, the program needs to output the phrase “Greater than 45.6.

Sample Run
Enter a number:90

Sample output
Greater than 45.6

Respuesta :

Answer:

a = float(input("Enter a number: "))

if(a > 45.6):

   print("Greater than 45.6")

Explanation:Code is in Python.

The program is an illustration of conditional statements.

Conditional statements are used to execute statements depending on the truth value of the condition.

The program in Python, where comments are used to explain each line is as follows:

#This gets input for the number

num = float(input("Enter a number:"))

#This checks if the number is greater than 45.6

if num > 45.6:

   #If yes, the appropriate text is printed

   print("Greater than 45.6")

#If otherwise, the program is exited

Only numbers greater than 45.6 will cause the statement in the condition to be executed.

See attachment for sample run

Read more about similar programs at:

https://brainly.com/question/19123086

Ver imagen MrRoyal
ACCESS MORE
ACCESS MORE
ACCESS MORE
ACCESS MORE