'''Sample Program to get 2 Number inputs '''
Num = input('Enter any Number :')
Num1 = input('Enter any Number :')
Total = Num + Num1 #-- --- Concatenates the values
print(Total)
print('Sum :',int(Num) + int(Num1))
print('Difference : ',int(Num) - int(Num1))
print('Multiplication : ',int(Num) * int(Num1))
print('Division : ',int(Num) / int(Num1))
print('Modulus : ',int(Num) % int(Num1))
To run python file:
- Navigate to the file path in Terminal using cd 'Path'
- Run python3 'File Name.py'
- Python processess every input received from the user as String. To perform any operations on the input , we need to typecast the input to desired datatype as above example.
Top comments (0)