Nested if demo,nestedifdemo,name = raw_i
Nested if demo,nestedifdemo,name = raw_i
name = raw_input('What is your name? ')if name.endswith('Yin'): if name.startswith('Mr.'): print 'Hello, Mr. Yin' elif name.startswith('Mrs.'): print 'Hello, Mrs. Yin' else: print 'Hello, Yin'else: print 'Hello, stranger'
相关内容
- String formatting,stringformatting,num = 1 / 3.
- Formatting example:center, rjust, ljust,rjustljust,string1 = 'N
- Generators,,def reverse(
- Draw rectangle with filled color,rectanglefilled,from Tkinter
- Printing ASCII,printingascii,i = 0while i
- Here are two ways to write a table of squares and cubes,squarescube
- Log print message into a file,logmessage,import syspr
- Use list as a stack: push onto stack,stackonto,L = []L.appe
- Zip three tuples,zipthreetuples,T1, T2, T3 =
- in a range,inrange,from math im
评论关闭