Python学习笔记2
Python数据类型和变量
请通过print打印出以下变量的值:
# -*- coding: utf-8 -*- n = 123 f = 456.789 s1 = 'hello,world' s2 = 'hello,\'adam\' s3 = r'hello,"bart"' s4 = r'''hello, lisa!'''
print('# -*- coding: utf-8 -*-','\nn = 123','\nf = 456.789',"\ns1 = 'hello,world'","\ns2 = 'hello,\\'adamr\\'","\ns3 = r'hello,\"bart\"'","\ns4 = r'''hello,\nlisa!'''") # -*- coding: utf-8 -*- n = 123 f = 456.789 s1 = 'hello,world' s2 = 'hello,\'adamr\' s3 = r'hello,"bart"' s4 = r'''hello, lisa!'''
- 下一篇:Python学习记录1
- 上一篇:Python学习笔记3
另外你代码错的地方还没改
我运行没有问题,看图,你是什么环境
In [1]: s = ‘hello, \’adamr\’
File “”, line 1
s = ‘hello, \’adamr\’
你网站超级慢,要转半天
可能是因为日服的原因。