0

hey guys i have written progam

from sys import argv

script, user_name = argv
prompt = '> '

print "Hi %s, I'm the %s script." % (user_name, script)
print "I'd like to ask you a few questions."
print "Do you like me %s?" % user_name
likes = raw_input(prompt)

print "Where do you live %s?" % user_name
lives = raw_input(prompt)

print "What kind of computer do you have?"
computer = raw_input(prompt)

print """
Alright, so you said %r about liking me.
You live in %r.  Not sure where that is.
And you have a %r computer.  Nice.
""" % (likes, lives, computer)

but irt getting error and i am solving it last three day snay idea wat's wrong and error is

Traceback (most recent call last):
  File "ex14.py", line 3, in <module>


    >>    script,user_name= argv

ValueError: too many values to unpack

please help!!!!!!!!!!

Edited by pyTony: Edited code format

2
Contributors
1
Reply
15
Views
2 Years
Discussion Span
Last Post by woooee
1

Not without knowing what argv contains. Print it and see for yourself.

print argv
print len(argv)

Edited by woooee

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.