Discuss / Python / 奇闻

奇闻

Topic source

print('n=123') ##直接输出字符串 print('f=456.789') #同上 print("s1='hello,world'") ##同上 print(r"s2 = 'hello, \'adam\''") ##用r" " 引号中内容不做注释 print('s3 = r\'hello, \"Bart\"') ##用转义字符 \'表示‘ \"表示" print(r"""s4 = r'''hello, lisa!'''""") ##用r" "引号中内容不做注释**

print('n =',n,'\nf =',f,'\ns1 =',s1,'\ns2 =',s2,'\ns3 =',s3,'\ns4 =',s4)


  • 1

Reply