Discuss / Python / 交作业了,打印变量的值

交作业了,打印变量的值

Topic source

n = 123 f = 456.789 s1 = 'Hello, world' s2 = 'Hello, \'Adam\'' s3 = r'Hello, "Bart"' s4 = r'''Hello, Lisa!''' print(n,f,s1,s2,s3,s4,sep='\n')

运行结果如下: 123 456.789 Hello, world Hello, 'Adam' Hello, "Bart" Hello, Lisa!

感谢,原来还能用 sep=''


  • 1

Reply