python中文注释及输出出错


    今天开始接触python,中文报错,你懂的,不细说。

    网上很多类似的解决方案,有不是很明确,例如:http://blog.csdn.net/chen861201/article/details/7706535

    方法有二,1、在代码开头加#coding=utf-8(注意要加#)

                        2、还是在代码开头加#-*- coding: utf-8 -*-(亲,还是要注意要加#)


   

#-*- coding: utf-8 -*-
#coding=utf-8
#hello world
print 'hello world'
'''
#if
if 1:
  print 'python'
else:
  print 'learning new language is a very happy things'
'''
#while循环
x=1
while x<=100:
  print 'I love python 第%d遍' %x
  print 'the second way to show '+str(x)
  x += 1 

 

 

 

转载于:https://www.cnblogs.com/james1207/p/3310540.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值