#!/usr/bin/python
num1 = int(raw_input('Enter a num:'))
num2 = int(raw_input('Enter second num:'))
add = num1 + num2
sub = num1 - num2
mul = num1 * num2
div = num1 / num2
print(add)
print(sub)
print(mul)
print(div)
Output:
$ python ./input.py
Enter a num:10
Enter second num:2
12
8
20
5
$ python ./input.py
Enter a num:2
Enter second num:10
12
-8
20
0
num1 = int(raw_input('Enter a num:'))
num2 = int(raw_input('Enter second num:'))
add = num1 + num2
sub = num1 - num2
mul = num1 * num2
div = num1 / num2
print(add)
print(sub)
print(mul)
print(div)
Output:
$ python ./input.py
Enter a num:10
Enter second num:2
12
8
20
5
$ python ./input.py
Enter a num:2
Enter second num:10
12
-8
20
0
No comments:
Post a Comment