FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
programmingWithPythonCode/questions/function_02.py at main · thomasWeise/programmingWithPythonCode · GitHub
thomasWeise
programmingWithPythonCode
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
programmingWithPythonCode
/
questions
/
function_02.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
19 lines (14 loc) · 457 Bytes
Breadcrumbs
programmingWithPythonCode
/
questions
/
function_02.py
Copy path
File metadata and controls
19 lines (14 loc) · 457 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
""" An example of a function. """
def
compute
(
number
:
int
)
->
int
:
"""
Perform a computation with the number `number`.
:param number: the input number
:return: the output number
"""
result
:
int
=
0
while
result
/
number
!=
number
:
result
+=
number
return
result
print
(
compute
(
4
))
# Line 17: What does it print?
print
(
compute
(
7
))
# Line 18: What does it print?
print
(
compute
(
0
))
# Line 19: What does it print?
Back
|
FazBrowse Home
|
New Git URL