FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python/function.py at master · moehuster/python · GitHub
moehuster
/
python
Public
Notifications
You must be signed in to change notification settings
Fork
1
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
python
/
function.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
40 lines (32 loc) · 766 Bytes
Breadcrumbs
python
/
function.py
Copy path
File metadata and controls
40 lines (32 loc) · 766 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
# computes the area of triangle
def
triangle_area
(
base
,
height
):
area
=
(
1.0
/
2
)
*
base
*
height
return
area
#test
a1
=
triangle_area
(
3
,
8
)
print
a1
a2
=
triangle_area
(
14
,
2
)
print
a2
# converts fahrenheit to celsius
def
fahrenheit2celsius
(
fahrenheit
):
celsius
=
(
5.0
/
9
)
*
(
fahrenheit
-
32
)
return
celsius
#test
c1
=
fahrenheit2celsius
(
22
)
c2
=
fahrenheit2celsius
(
212
)
print
c1
,
c2
# converts fahrenheit to kelvin
def
fahrenheit2kelvin
(
fahrenheit
):
celsius
=
fahrenheit2celsius
(
fahrenheit
)
kelvin
=
celsius
+
273.15
return
kelvin
#test
k1
=
fahrenheit2kelvin
(
32
)
k2
=
fahrenheit2kelvin
(
213
)
print
k1
,
k2
# print hello, world!
def
hello
():
print
"hello, world!"
#test
h
=
hello
()
print
h
Back
|
FazBrowse Home
|
New Git URL