Simple addition program. : Console Read : Development PYTHON examples


PYTHON examples » Development » Console Read »

 

Simple addition program.


Simple addition program.



# prompt the user for input
integer1 = raw_input"Enter first integer:n" )  # read a string
integer1 = intinteger1 )                        # convert the string to an integer

integer2 = raw_input"Enter second integer:n" # read a string
integer2 = intinteger2 )                        # convert the string to an integer

sum = integer1 + integer2                         # assignment of sum

print "Sum is", sum                               # print sum



           
       



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo Development
» Console Read