课程
/后端开发
/Python
/初识Python
x1 = 1 >>> d = 3 >>> n = 100 >>> x100 = x1 + (n - 1) * d >>> s = (x1 + x100) * n / 2 >>> print ('s') SyntaxError: multiple statements found while compiling a single statement
2016-07-28
源自:初识Python 3-4
正在回答
我觉得错在x=1那一行
s和‘s’表示的内容不同,前面的意思是变量,后面的就是字符,print('s')的结果其实就跟print(“hello world”)类似,打印字符串而已
雪夜逐光 提问者
最后一行打印的是字符串's',可以改为 print s
举报
学python入门视频教程,让你快速入门并能编写简单的Python程序
购课补贴联系客服咨询优惠详情
慕课网APP您的移动学习伙伴
扫描二维码关注慕课网微信公众号