-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2.OperatorInputs.py
46 lines (35 loc) · 981 Bytes
/
2.OperatorInputs.py
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
# Python operators and inputs
name= "Python"
print(name)
print('Hello, What is your name?')
# input() is to read the input from customer
name = input()
print("your name is", name)
# Below are the basic Operators of python
# + addition
# - Subtraction
# / Divide
# * Multiplication
num1 = 45
num2 = 55
print("sum" , num1 + num2)
print("sub" , num1 - num2)
print("div" , num1 / num2)
print("mul" , num1 * num2)
# few more operators
# ** exponent
# // integer division, return only inter and not reminder
# % return reminder
print(3**3) # output is 3 * 3 * 3
print (75 // 10 )
print(75%10)
print("Enter a number ?")
number = input();
print("Enter another number ?")
anothernumber = input()
# below method help to find what type of data is
print("anothernumber is a ", type(anothernumber))
# Note: all the input will be string ata type by default
# we need to convert before perform any mathematical operation
SUM = (int(number) + int(anothernumber))
print("Sum is", SUM)