Discuss / Python / 打卡练习:1

打卡练习:1

Topic source

CityeBox

#1 Created at ... [Delete] [Delete and Lock User]

n = 123

f = 456.789

s1 = 'Hello, world'

s2 = 'Hello, \'Adam\''

s3 = r'Hello, "Bart"'

s4 = r'''Hello,Lisa!'''

print('n','=',n,'\n''f','=',f,'\n''s1','=',s1,'\n''s2','=',s2,'\n''s3','=',s3,'\n''s4','=',s4,'\n')

print('n =',n,'\n''f =',f,'\n''s1 =',s1,'\n''s2 =',s2,'\n''s3 =',s3,'\n''s4 =',s4)

这样更简洁一些。

CityeBox

#3 Created at ... [Delete] [Delete and Lock User]

受教了,谢谢指点

这样更更简捷一些:print('n=',n,'\nf=',f,'\ns1=',s1,'\ns2=',s2,'\ns3=',s3,'\ns4=',s4)


  • 1

Reply