-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmath-sk.py
47 lines (29 loc) · 1.12 KB
/
math-sk.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#import math (import this module for mathematics operation)
#math.sqrt(X)...square root of X | math.ceil(x)...round a no up | math.floor(x)...round a no down
#import math
#x = 9.9
#print(math.pi)
#print(math.e)
#result = math.sqrt(x)
#result = math.ceil(x)
#result = math.floor(x)
#print(result)
#calculate circumference of a circle (c = 2 pie r) #round(circumference, 2) means the float no after . is round with 2 digit
#import math
#radius = input("Enter the radius of a circle")
#radius = float(input("Enter the radius of a circle"))
#circumference = 2 * math.pi * radius
#print(f"The circumference is: {circumference}")
#print(f"The circumference is: {round(circumference, 2)}cm")
# Area of a circle A = pie r*2
#import math
radius = float(input("Enter the radius of a circle: "))
#area = math.pi * pow(radius, 2)
#print(f"The area of the circle is: {area}")
#print(f"The area of the circle is: {round (area, 2)} cm")
#hypotenuse of a triangle (c = sqrt of a*2 + b*2)
#import math
#a = float(input("Enter side A: "))
#b = float(input("Enter side B: "))
#c = math.sqrt(pow(a,2) + pow(b,2))
#print(f"Side c: {c}")