Add shipping project.
This commit is contained in:
parent
04a799c56e
commit
019673fe62
|
@ -87,10 +87,16 @@ strings"""
|
||||||
True = int(1)
|
True = int(1)
|
||||||
False = int(0)
|
False = int(0)
|
||||||
|
|
||||||
|
## Boolean Expressions
|
||||||
|
|
||||||
|
`and` evaluates true if both are true.
|
||||||
|
`or` evaluates true if either are true.
|
||||||
|
`not` return the opposite boolean value.
|
||||||
|
|
||||||
## Relational Operators (ch.4, ex. 3)
|
## Relational Operators (ch.4, ex. 3)
|
||||||
|
|
||||||
`==` returns `True` if is is equal and returns `False` otherwise.
|
`==` returns `True` if is is equal
|
||||||
`!=` returns `True` if is is NOT equal and returns `False` otherwise.
|
`!=` returns `True` if is is NOT equal
|
||||||
|
|
||||||
Here are more of he same kind of operator:
|
Here are more of he same kind of operator:
|
||||||
|
|
||||||
|
@ -98,9 +104,8 @@ False = int(0)
|
||||||
`<` less than
|
`<` less than
|
||||||
`>=` greater than or equal to
|
`>=` greater than or equal to
|
||||||
`<=` less than or equal to
|
`<=` less than or equal to
|
||||||
|
# if, else, if else
|
||||||
|
`elif` = if else
|
||||||
|
|
||||||
|
|
||||||
# Datatypes
|
# Datatypes
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
def ground_shipping(weight):
|
||||||
|
flat = 20.00
|
||||||
|
|
||||||
|
if weight <= 2:
|
||||||
|
cost = flat + 1.50 * weight
|
||||||
|
if (weight > 2) and (weight <= 6):
|
||||||
|
cost = flat + weight * 3.00
|
||||||
|
if (weight > 6) and (weight <= 10):
|
||||||
|
cost = flat + weight * 4.00
|
||||||
|
if (weight > 10):
|
||||||
|
cost = flat + weight * 4.75
|
||||||
|
|
||||||
|
return cost
|
||||||
|
|
||||||
|
premium_ground_shipping = 125.00
|
||||||
|
|
||||||
|
print(premium_ground_shipping(8.4))
|
Loading…
Reference in New Issue