-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtasks.py
More file actions
50 lines (33 loc) · 1.04 KB
/
Copy pathtasks.py
File metadata and controls
50 lines (33 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#1 Hello world
print('Hello World!')
#2 Simple Calculator
def add_numbers():
print("This is addition")
number1 = int(input("Enter number1: "))
number2 = int(input("Enter number2: "))
sum = number1 + number2
print(f"Addition is: { sum }")
def subtraction_numbers():
print("This is subtraction")
number1 = int(input("Enter number1: "))
number2 = int(input("Enter number2: "))
subtraction = number1 - number2
print(f"Subtraction is: { subtraction }")
def multiplication_numbers():
print("This is multiplication")
number1 = int(input("Enter number1: "))
number2 = int(input("Enter number2: "))
multi = number1 * number2
return multi
add_numbers()
subtraction_numbers()
multiplication = multiplication_numbers()
print(f"multiplication is: { multiplication }")
#Odd or Even Checker
def check_odd_or_even():
number = int(input("Enter number1: "))
if number % 2 == 0:
print(f"your { number } is even")
else:
print(f"Your { number } is odd")
check_odd_or_even()