-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex12.py
More file actions
20 lines (12 loc) · 858 Bytes
/
ex12.py
File metadata and controls
20 lines (12 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#When you typed input(), you were typing the ( and ) characters, which are parenthesis characters. This is similar to when you used them to do a format with extra variables, as in "%s %s" % (x, y). For raw_input, you can also put in a prompt to show to a person
#so he knows what to type. Put a string that you want for the prompt inside the () so that it looks
#like this:
#y = input("Name? ")
#This prompts the user with “Name?” and puts the result into the variable y. This is how you ask
#someone a question and get the answer.
#This means we can completely rewrite our previous exercise using just raw_input to do all the
#prompting.
age = input("How old are you? ")
height = input("How tall are you? ")
weight = input("How much do you weigh? ")
print("So, you're %r old, %r tall and %r heavy." % (age, height, weight))