Question: #Assaignment 1 . py # Get the user's name name = input ( Please enter your name: ) print ( Hello World,
#Assaignmentpy
# Get the user's name
name inputPlease enter your name:
printHello World, from name
# Print an additional message
printI am very excited to learn coding!"
#Assaignemnt py
#get user input
userinput inputEnter a number:
# Calculate the square of the input number
square floatuserinput
# Print the square
printSquare of the input number:", square
# Determine if the input is a triangle or not
shapeinput inputEnter a shape triangle or another shape:
if shapeinput.lower "triangle":
# If the shape is a triangle, calculate the area
base floatinputEnter the base of the triangle:
height floatinputEnter the height of the triangle:
areaoftriangle height base
printfThe area of the triangle is: areaoftriangle
elif shapeinput.lower "square":
# If the shape is a square, calculate and print the square again
square floatuserinput
printSquare of the input number:", square
else:
# If the shape is neither triangle nor square, print a message
printUnsupported shape. Please enter either 'triangle' or 'square'." turned these codes into loop python
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
