f826539110
f826539110
2016-03-31 06:24

本方法学python 练习14报错

  • python

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 s few questions.")
print("Do you like me %s?"%user_name)
likes = input(prompt)

print("Where do you like %s?"%user_name)
lives = input(prompt)

print("What kind of computer do you have?")
computer = input(prompt)
print("""
Alright,so you said %r about liking me.
You libe in %r.Not sure where that is.
And you have a %r computer.Nice.
""" %(likes,lives,computer))
报错:
Traceback (most recent call last):
File "ex14.py", line 3, in
script,user_name = argv
ValueError: not enough values to unpack (expected 2, got 1)

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

4条回答