Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions

Question

=+19.4. Consider weak convergence in LP((0, 1], @, ).

Answered: 1 week ago

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago