数日前に Python の学習を始めたばかりで、Learn Python the Hard Way 演習に取り組んでいます。while ループをいじっているだけで、なぜこれがループとループとループを続けるのかわかりません。これは基本的に、リストにデータを入力して内容を出力する単なる関数です。
from sys import argv
script = argv
print "This script is called %s." % script
print "It allows a list to be populated with a number"
print "Please enter that number:"
whilevar = raw_input()
i = 0
numbers = []
def list_numbers(i, whilevar):
while i < to whilevar:
print "At the top i is %d" % i
numbers.append(i)
i = i + 1
print "number present in list now ", numbers
list_numbers(i, whilevar)
print "The numbers:"
for z in numbers:
print z
それはおそらく本当に基本的なものですが、どういうわけか見逃しています。
ありがとう