-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e1199db
commit 32fb9cc
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
def greet(name): | ||
|
||
def message(): | ||
return "How u doin :)!" | ||
|
||
return f"Sup, {name}. {message()}" | ||
name=input("Enter you name:") | ||
print(greet(name)) | ||
|
||
|
||
def calculator(a, b): | ||
def add(): | ||
return a + b | ||
|
||
def subtract(): | ||
return a - b | ||
|
||
def multiply(): | ||
return a * b | ||
|
||
def divide(): | ||
return a / b if b != 0 else "Division by zero!" | ||
|
||
return { | ||
"add": add(), | ||
"subtract": subtract(), | ||
"multiply": multiply(), | ||
"divide": divide() | ||
} | ||
|
||
a=int(input("Enter a number:")) | ||
b=int(input("Enter a number:")) | ||
results = calculator(a,b) | ||
print("Addition:", results["add"]) | ||
print("Subtraction:", results["subtract"]) | ||
print("Multiplication:", results["multiply"]) | ||
print("Division:", results["divide"]) |