码迷,mamicode.com
首页 > 其他好文 > 详细

Keyboard input

时间:2014-05-01 19:23:26      阅读:392      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   width   get   int   string   2014   http   cti   com   

Keyboard input

Python provides a build-in function called raw_input (in version 2.x) that gets input from the keyboard. In Python 3.x we use input(). When this function is called, the program stops and waits for the user to type something. When the user presses Return or Enter, the program resumes and input() returns what the user typed as a string.

mamicode.com,码迷                       

Before calling input(), it is a good idea to print a prompt telling the user what to input. input() takes a prompt as an argument:

 mamicode.com,码迷

 

from Thinking in Python

 

Keyboard input,码迷,mamicode.com

Keyboard input

标签:des   style   blog   width   get   int   string   2014   http   cti   com   

原文地址:http://www.cnblogs.com/ryansunyu/p/3702843.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!