This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: 1 ECS 10 10/2 Announcements Âˇ Second program due Tuesday night. Âˇ I will be at Monday lab hours. Last time â€“ getting user input name = raw_input(â€śWhat is your name? â€ś) Âˇ This is an assignment statement. name is a variable Âˇ name is a variable. Âˇ The value of: raw_input(â€śWhat is your name? â€ś) â€¦.will be whatever the user types as input. Enter to exit Enter to exit Âˇ Many examples in the book end with: Many examples in the book end with: raw_input(â€śPress enter to exitâ€ť) Âˇ Python waits for the user to enter something. Python waits for the user to enter something. As soon as the user hits the enter key, the As soon as the user hits the enter key, the program is done and it exits. program is done and it exits. Âˇ Notice the value produced by Notice the value produced by raw_input raw_input() is () is not put into a variable; it is just thrown away. not put into a variable; it is just thrown away. 2 The empty string Âˇ When the user just types the Enter key, raw_input() produces a string, but it is a string...
View Full Document
- Spring '07
- ASCII, Imperative programming, press enter