題解|ZeroJudge a001. 哈囉

【題目】a001. 哈囉

題解

a001.py
1
2
n=input()
print("hello,",n)

解說

題目要求我們輸出hello, <輸入的字串>
所以我們依照題意,先宣告一個變數n用來接收輸入的字串,
然後我們再寫print("hello,",n)
至於輸出結果的逗號跟變數之間的空格不用擔心,因為print()函數預設的sep是一個空格(延伸閱讀:題解|ZeroJudge a135. 12250 - Language Detection

結語

以上就是本題題解。
倘內容有誤或仍有疑問,歡迎在下方留言區留言!