FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-bootcamp/Lectures/03_FunctionsAndModules/numfun2.py at master · profjsb/python-bootcamp · GitHub
profjsb
/
python-bootcamp
Public
Notifications
You must be signed in to change notification settings
Fork
226
Star
238
Code
Issues
1
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-bootcamp
/
Lectures
/
03_FunctionsAndModules
/
numfun2.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
22 lines (18 loc) · 584 Bytes
Breadcrumbs
python-bootcamp
/
Lectures
/
03_FunctionsAndModules
/
numfun2.py
Copy path
File metadata and controls
22 lines (18 loc) · 584 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
"""
small demo of modules
"""
## do some stuff and set some variables
print
(
"numfun2 in the house"
)
x
=
2
s
=
"spamm"
def
numop1
(
x
,
y
,
multiplier
=
1.0
,
greetings
=
"Thank you for your inquiry."
):
"""
Purpose: does a simple operation on two numbers.
Input: We expect x,y are numbers
multiplier is also a number (a float is preferred) and is optional.
It defaults to 1.0. You can also specify a small greeting as a string.
Output: return x + y times the multiplier
"""
if
greetings
is
not
None
:
print
(
greetings
)
return
(
x
+
y
)
*
multiplier
Back
|
FazBrowse Home
|
New Git URL