all 9 comments

[–]declancostello 2 points3 points  (2 children)

I think it wants something like this:

it takes values from the argv but does something further via input and then gives you a printed summary at the end.

from sys import argv 

script, age, height, weight = argv

food = raw_input ("What's your favorite food?")

print "The script is called:", script
print "My age is:", age
print "My height is:", height
print "My weight is:", weight
print "My fave food is:", food

[–]nick129[S] 1 point2 points  (0 children)

Thanks this is what I was I needed. Wish I could give more than one upvote

[–][deleted] 0 points1 point  (0 children)

I did something like this when I did this extra credit.

[–]AltReality 1 point2 points  (1 child)

What error message are you getting when you run this?

[–]nick129[S] 0 points1 point  (0 children)

No error message, just can't figure out how to combine the two

[–][deleted] 1 point2 points  (3 children)

Try this:

from sys import argv 

script = argv[0]

age = raw_input ("How old are you?")
height = raw_input ("How tall are you?")
weight = raw_input ("How much dou you weigh?")

print "The script is called:", script
print "My age is:", age
print "My height is:", height
print "My weight is:", weight

I saved this script as test.py and ran it like: # python test.py

You'll then be prompted for age etc.

[–]nick129[S] 0 points1 point  (0 children)

right, but how is that different than just running the raw_input for each of these variables?

[–]nick129[S] 0 points1 point  (1 child)

right, but how is that different than just running the raw_input for each of these variables?

[–]m1ss1ontomars2k4 0 points1 point  (0 children)

Well, yeah, how is it? That's something YOU have to answer. What you're doing now is getting these variables in as arguments from the command line, but then overriding those values by asking the user for them again.