# -*-coding:utf-8-*-""" 如果注釋裡面需要中文 需要加上上面的代碼"""age = input('you think you input number ?')age10 = int(age) + 10print 'you age is ' + str(age10) """ 這裡需要注意 輸出的時候 需要將age10轉換為str """ages = 3 * '5'print type(ages)"""<type 'str'>"""jack1 = 3 * 5.0print type(jack1)"""<type 'str'>"""print ('jack', 'hello', 'world')print ('jack', 'java')# 這是一個行注釋 """ 這是一個行列注釋"""print False == Falseprint False and Falseprint not True# this is if number = input('you input win number ')if number == 10: print 'yes 'elif number == 20: print 'no'# this is if two hopeyou = raw_input("you name ")if hopeyou == 'jack': print'yes 'elif hopeyou == 'pcc': print 'you name is' + hopeyouelif hopeyou == 'kt': print " yes"else: print 'hack'# this is if elifpwd = input('what is the passwordl ?')if pwd == 'apple': print 'win'elif pwd == 'a': print'root'else: print 'out '
問題說明:根據作者使用 好像在使用 raw_input的時候在控制台進行輸入的時候,當輸入String or char的時候不要加引號.但是如果使用是input的話,必須使用引號