HKGalden學術臺
發表文章發起投票
python 問題
我打段咁既野出黎
x = raw_input("please input a number:")
y= x + 10
print "if you use a number: " + x + "10" + "it will become: " + y

佢出
Traceback (most recent call last):
File "C:\Usersy\acv\Desktop\132.py", line 2, in <module>
y= x + 10
TypeError: cannot concatenate 'str' and 'int' objects
姐係點
要用野quote佢定係改D code

另外我想問下STR() INT()幾時用
仲有
for element in range(50)
for counts in range(50)
for number in range(50)
有咩分別 for 後面個字係唔係鳩打都得
Good0Bad1
2015/06/01, 2:42:01 下午
本貼文共有 0 個回覆
此貼文已鎖,將不接受回覆
發表文章發起投票