Python - The range() Function to Get a Range of Values - Python Programming Example - APPFICIAL

Опубликовано: 28 Сентябрь 2021
на канале: Appficial
9,948
73

The range() function can take up to three integer arguments.

range(Y) generates a sequence of all non-negative integers less than Y.Ex: range(5) creates the sequence 0, 1, 2, 3, 4.
range(X, Y) generates a sequence of all integers greater than or equal to X and less than y Y.Ex: range(-2, 2) creates the sequence -2, -1, 0, 1
range(X, Y, Z), where Z is positive, generates a sequence of all integers greater than or equal to X and less than Y, incrementing by Z.Ex: range(0, 40, 10) creates the sequence 0, 10, 20, 30.
range(X, Y, Z), where Z is negative, generates a sequence of all integers less than or equal to X and greater than Y, incrementing by Z.Ex: range(5, -1, -1) creates the sequence 5, 4, 3, 2, 1, 0.

Subscribe to Appficial for more programming videos coming soon. Also, don't forget to click LIKE and comment on the video if it helped you out!


На этой странице сайта вы можете посмотреть видео онлайн Python - The range() Function to Get a Range of Values - Python Programming Example - APPFICIAL длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Appficial 28 Сентябрь 2021, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 9,948 раз и оно понравилось 73 зрителям. Приятного просмотра!