Simple addition program.,simpleaddition,# prompt the
Simple addition program.,simpleaddition,# prompt the
# prompt the user for inputinteger1 = raw_input( 'Enter first integer:\n' ) # read a stringinteger1 = int( integer1 ) # convert the string to an integerinteger2 = raw_input( 'Enter second integer:\n' ) # read a stringinteger2 = int( integer2 ) # convert the string to an integersum = integer1 + integer2 # assignment of sumprint 'Sum is', sum # print sum
- String formatting: Fifteen and five characters allowed i
- Formatted print: string,formattedprint,print '%s+%s
- Print a formatted price list with a given width,format
- Random Choice,randomchoice,import rando
- Simple Script That Counts the Words in sys.stdin,count
- Redirects prints to file,redirectsprints,x = 99y = 'H
热门文章:
相关内容
- String formatting: Fifteen and five characters allowed in string,fo
- Formatted print: string,formattedprint,print '%s+%s
- Print a formatted price list with a given width,formattedgiven,widt
- Random Choice,randomchoice,import rando
- Simple Script That Counts the Words in sys.stdin,countssys.stdin,im
- Redirects prints to file,redirectsprints,x = 99y = 'H
- Redirecting Error Information,,import sys f
- Get user input,getuserinput,car = raw_i
- Introducing or,introducingor,print 'a' or
- Use # to start a comment,,SPAM = 1
评论关闭