Computer >> Hướng Dẫn Máy Tính >  >> Lập Trình >> Python

Hàm raw_input() trong Python làm gì?


Hàm raw_input() hiển thị prompt (optional arg), nhận input user trả về string.

name = raw_input("What is your name? ")
print "Hello, %s." % name

Khác input() cố interpret input; tốt nhất tránh input(), dùng raw_input() + custom parsing.