關于print('hello,', 'python.')輸出結果是 ('hello,', 'python.'),而不是hello, python.
代碼:
print('hello, python.')
print'hello,', 'python.'
print('hello,', 'python.')
輸出:
hello, python.
hello, python.
('hello,', 'python.')
問題:
最后python3里面加上括號,為什么輸出不是 hello, python 而是 ('hello,', 'python.')
?
2021-07-06
this is test
2020-06-06
Python3 里面,print()是一個函數,所以要加括號,輸出來是沒有括號的。
2020-02-24
各位看看是這樣嗎??
print 'hello'+ ', python'
2020-02-21
print('hello,''python')
2020-02-21
在python中把print當做一個函數使用所以要用print()
2020-02-16
有可能當成了turpe,畢竟它是用小括號的,要看Python的版本了。。。
2020-02-03
首先先嘗試一下以下代碼是否可以正常輸出?
print ('hello'',''python.')
如果不出意外應該是可以正常輸出hello,python.?
題主print('hello,','python.') 無法輸出正確答案原因是,hello后面第二個逗號“,”并非輸出結果的逗號而是變成了區分前后" ('hello,',? " 和? " 'python.') "這兩個字符串的空格了
初學者,如果不對請多多指教,十分感謝!
2020-01-31
python3版本問題
2020-01-20
它應該是以為你是list了吧,然后就把list打印出來了
2019-11-11
如果你要這樣寫的話,應該寫成
print('hello'),('python')