We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 51053cb commit de04476Copy full SHA for de04476
1 file changed
SimpleAddition/Sum_2_numbers.py
@@ -1 +1,24 @@
1
+# first lets get 2 numbers to add
2
+print "enter 2 number to add"
3
4
+# getting the first number
5
+number1 = raw_input("Ok enter the first number ")
6
+
7
+# and now the second number
8
+number2 = raw_input("and now the second number ")
9
10
+# finally calculating the addidition of the numbers
11
+# sum = number1 + number2
12
+# seems to be right
13
+# but as the inputs are taken as string we need to type cast them
14
+# that is convert number1 and number2 to integer from string
15
+# so lets do that
16
17
+number1 = int(number1)
18
+number2 = int(number2)
19
+# and now lets calculate the sum
20
+sum = number1 + number2
21
22
+# and now lets print the numbers
23
+print "the addition of the 2 numbers is "
24
+print sum
0 commit comments