FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
My-Python-Code/Clean-Codes.py at main · aminzayer/My-Python-Code · GitHub
aminzayer
/
My-Python-Code
Public
Notifications
You must be signed in to change notification settings
Fork
1
Star
3
Code
Issues
0
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
My-Python-Code
/
Clean-Codes.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
13 lines (10 loc) · 400 Bytes
Breadcrumbs
My-Python-Code
/
Clean-Codes.py
Copy path
File metadata and controls
13 lines (10 loc) · 400 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
# if-guard-clause
# Calculate Total Price
def
total_price
(
authenticated
:
bool
,
item_price
:
int
,
item_quantity
:
int
)
->
str
|
str
:
if
not
authenticated
:
return
"User is not authenticated."
if
item_price
<=
0
:
return
"Price must be greater than 0."
if
item_quantity
<=
0
:
return
"Quantity must be greater than 0."
return
item_price
*
item_quantity
Back
|
FazBrowse Home
|
New Git URL