-
Notifications
You must be signed in to change notification settings - Fork 0
/
lab1.py
35 lines (26 loc) · 964 Bytes
/
lab1.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
# Name: Sanjidah Abdullah
# Session: Morning - In Class Assignment 1
import math
#A
minutes = 42
seconds = (minutes * 60) + 42
print ("A) There are",seconds,"seconds in 42 minutes and 42 seconds.")
#Answer: 2562 seconds
#B
volumeOfFour = (4/3) * (math.pi) * (4 ** 3)
volumeOfSix = (4/3) * (math.pi) * (6 ** 3)
print ("B) The volume of a sphere with radius 4 is: ",volumeOfFour, \
", and volume of a sphere with radius 6 is: ",volumeOfSix)
#Answer: Volume of a sphere with radius 4 is 268.082573106329
#Answer: Volume of a sphere with radius 6 is 904.7786842338603
#C
farenheitDegrees = -40
celsiusDegrees = (farenheitDegrees - 32) * (5/9)
print ("C)",int(farenheitDegrees), " degrees farenheit is equivalent to",int(celsiusDegrees), "degrees celsius. ")
#Answer: -40 degrees farenheit is equivalent to -40 degrees celsius.
#D
a = 1
R = a * (2*a) * (3*a)
C = (a ** 3)
print ("D)",int(R/C), "cubes can fit in R." )
#Answer: 6 cubes can fit in R