[Python] formatted output

1 name = the INPUT ( " Enter name " )
 2 Age = the INPUT ( " Please enter the Age " )
 3 shengao = the INPUT ( " Please enter height " )
 4 msg = " My name is% s, age,% s, height% S " % (name, Age, shengao) # % placeholder, s represents Alternatively character sequence instead. 
5  Print (msg)
= Msg2 '' ' --------------------------------------------- 
        name:% s 
        Age:% s 
        height:% s 
-------------------------------------- -------------- '' ' % (name, Age, shengao)
= name " ha ha " 
msg = " My name is% s %% learning progress 3 " % (name)
 Print (msg) 
# result: Haha I'm learning progress 3%

 

Guess you like

Origin www.cnblogs.com/yang30293316/p/11220217.html