Question: user _ input = input ( enter a number: ) #calculate the square of input number square = float ( user _ input )

user_input=input("enter a number:")
#calculate the square of input number
square=float(user_input)**2
#print the square
print("square of the the input number:",square)
#find the area of triangle
base=float(input("enter the height of triangle:"))
height=float(input("enter the base of triangle:"))
area_of_triangle=(height*base)/2
print(f"the area of triangle is: {area_of_triangle:}") convert these codes to if elif and logic

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!