-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrial 1.py
More file actions
65 lines (43 loc) · 1.07 KB
/
trial 1.py
File metadata and controls
65 lines (43 loc) · 1.07 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
__author__ = 'Administrator'
# a=5
#
# b=8
#
# if a>b:
# print ("True")
# elif:
# print ("False")
def square_return(num):
return num ** 2
def square_print(num):
print("The square of num is", num ** 2)
def area(base, height):
'''(number, number) -> number
Return the area of a triangle with dimensiosn
base and height.
'''
return base * height / 2
def convert_to_celsius(fahrenheit):
''' (number) -> float
Returns the number of Celsius degrees equivalent to fahrenheit degrees.
'''
return (fahrenheit - 32) * 5 / 9
def convert_to_minutes(num_hours):
''' (int) -> int
Return the number of minutes there are in num_hours hours!
>>> convert_to_minutes(2)
120
'''
result = num_hours * 60
return result
def convert_to_seconds(num_hours):
''' (int) -> int
Return the number of seconds there are in num_hours hours!
>>> convert_to_seconds(2)
7200
'''
minutes = convert_to_minutes(num_hours)
seconds = minutes * 60
return seconds
seconds = convert_to_seconds(2)
dir(math)