Академический Документы
Профессиональный Документы
Культура Документы
BSCpE - IV
1. Create a script that will let the user enter the radius of a circle and computer for its
circumference.
print ("The circumference of the circle with radius " + str(r) + " is: " + str(2*pi * r))
2. Create a script that will calculate the area of a square and a right triangle.
RIGHT TRIANGLE
import math
import sys
# A= (1/2)*base*height
if(type == 1):
base = float(input("Enter the base: "))
height = float(input("Enter the height: "))
area = (1/2)*base*height
print("The area of the triangle is ", area)
# A = (1/2)*side1*side2*sin(angle)
if(type == 2):
if(type == 3):
import math
import sys
import math
import sys
if(type == 1):
if(type == 3):