-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClass3.py
More file actions
37 lines (28 loc) · 725 Bytes
/
Class3.py
File metadata and controls
37 lines (28 loc) · 725 Bytes
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
def example(name):
print ("Hi")
print (name)
def namesfunction(first):
print("Hi")
print(first,"Edwards")
def subtract(a,b):
return (a-b)
def compare(a,b,opposite=0):
if (a > b and opposite == 0):
print(a,"is greater than",b)
elif (a == b):
print(a,"is equal to",b)
elif (a>b and opposite == 1):
print(b,"is not greater than",a)
else:
print(a,"is not greater than",b)
example("Vikram")
namesfunction("John")
namesfunction("Frank")
namesfunction("Greg")
x = subtract(12,5)
print(x)
compare(35,12)
print("Enter numbers to compare")
num1 = int(input("Enter first number: "))
num2 = int(input("Enter second number: "))
compare(num1,num2,1)