Français
Ouvrir dans Telegram

Fil de discussionПривет! Подскажите, пожалуйста, почему тут i итерируется дважды а не трижды?

4 messages · –
O
Привет! Подскажите, пожалуйста, почему тут i итерируется дважды а не трижды? for i in range(1,3): print(i)
  1. 🍉
    Language: py3 Source: print(range.__doc__) Result: range(stop) -> range object range(start, stop[, step]) -> range object Return an object that produces a sequence of integers from start (inclusive) to stop (exclusive) by step. range(i, j) produces i, i+1, i+2, ..., j-1. start defaults to 0, and stop is omitted! range(4) produces 0, 1, 2, 3. These are exactly the valid indices for a list of 4 elements. When step is given, it specifies the increment (or decrement).
      1. K
        Вы увеличили карму 🍉 до 1296.10 (+1.00)
ССообщество Python ПрограммистовСообщество Python Программистов@python_scripts · groupe · Technologie
4 169membres43écrivent en 30 jours
Fil de la communauté Ouvrir dans Telegram

Un fil public ouvert issu de l'index de recherche ChatCrawler — « le Google du Telegram public » ; actualisé à mesure que la communauté est explorée. Les heures sont en UTC.

Contenu public uniquement, API officielle de Telegram. À propos · FAQ · Limites de l'index · Retirer une page · Catalogue · Recherche · Comment nous comptons