Skip to content

Commit

Permalink
Exchange raw_input with input() or eval(input()).
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph Pan committed Jan 9, 2014
1 parent 9e2c1c6 commit 0acfdd8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions Python3/ex11.py
Expand Up @@ -15,9 +15,8 @@
print("So, you're %r old, %r tall and %r heavy." % (age, height, weight))

print("Enter a integer: ", end=" ")
num = int(raw_input()) # won't work with int(raw_input)), with eval(input()) it would work
num = int(eval(input())) # won't work with int(raw_input)), with eval(input()) it would work
print("The number you've input is: %d" % num)

print("Enter a name: ", end=" ")
name = input()
print("What's %s's age?" % name, end=" ")
Expand Down
8 changes: 4 additions & 4 deletions Python3/ex12.py
@@ -1,9 +1,9 @@
#!/bin/python3

# ex12: Prompting People
# exchange raw_input with input() or eval(input())
age = raw_input("How old are you?")
height = raw_input("How tall are you? ")
weight = raw_input("How much do you weigh? ")

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))

0 comments on commit 0acfdd8

Please sign in to comment.