FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
programmingWithPythonCode/syntax/const_unary_function.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
/
syntax
/
const_unary_function.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
9 lines (7 loc) · 345 Bytes
Breadcrumbs
programmingWithPythonCode
/
syntax
/
const_unary_function.py
Copy path
File metadata and controls
9 lines (7 loc) · 345 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
"""The syntax of a unary function always returning a constance value."""
def
const_1
(
x
:
float
)
->
float
:
return
1.0
# always return 1.0, regardless of the value of x
# or
# It is common to use "_" as name for parameters that we will ignore.
def
const_1
(
_
:
float
)
->
float
:
return
1.0
# always return 1.0, parameter "_" is ignored.
Back
|
FazBrowse Home
|
New Git URL