0
    people = int(input("give me the amount of people who want to auction(must be less than 101 and more than 0"))
if people < 1:
  print("you arn't so popular after all")
elif people > 100:
  print("you were banned for having to much pepole")
else:
 print(people)
 for i in (0,people):
  print("i")

if you put in a number like ten, it will only print 2 "i"'s

Sythcin
  • 1
  • 2

1 Answers1

5

maybe because (0, people) is a tuple and only have two values: 0 and people.

I think it should be something like range(0, people).

Update

Yep, that was the case (it was a tuple), and according to the @CrazyChucky comment to this response a better way to do this could be:

for _ in range(people):
  # do something here...
  • 1
    Or even `for i in range(people):` since [`range`](https://docs.python.org/3/library/stdtypes.html#range) starts at zero by default. And since the value of `i` isn't being used (should `"i"` be `i`?), it could be `for _ in range(people):` or just `for _ in people:`. (An [underscore](https://stackoverflow.com/questions/5893163/what-is-the-purpose-of-the-single-underscore-variable-in-python/5893946) is conventionally used as a "throwaway" variable.) – CrazyChucky May 07 '21 at 23:13
  • @CrazyChucky thaaanks, what do you mean with `for _ in people:`? In that way it tells me that int object is not iterable. – Jonathan Gómez Pérez Jun 09 '21 at 23:25
  • I don't think `for _ in people:` will work. if you do that, people has to be a list, string etc. – ppwater Jun 10 '21 at 00:28
  • That's correct, I apparently had a brain fart on that last suggestion. – CrazyChucky Jun 10 '21 at 11:36