Everyone Gets THIS Wrong In Python At Least Once

preview_player
Показать описание
Everyone gets this wrong in Python at least once. #python #code #programming
Рекомендации по теме
Комментарии
Автор

happened to me once , spent half an hour trying to find where the bug was

Lol-iluc
Автор

in most programing languages and specially in the python the rule is that the first argument is inclusive and the second one is exclusive.

xzex
Автор

Bro, you made my days! Keep uploading!

oskar_wild_
Автор

Start, Stop, Step. Have this memorize.

purplecrayon
Автор

My maths lecturer would get absolutely peeved that you called 0 <= k <= n a positive range.

-rya
Автор

negative = range(-3, 1)
print(list(negative))

hawaiihiker
Автор

Why isn't the step implicitly -1 when the second argument is smaller than the first?

humanrightsadvocate
Автор

It’s not direction. It’s number of step

ParkYongwooAmi
Автор

Minor detail, 0 is not positive (nor negative)

available
Автор

how to print 15 to 0

I use:
a = 15
for I in range(15) :
print(a)
a -= 1

nvs-different-ideas
Автор

I always write (0, n, 1) even in the case of positive numbers

abhishankpaul
Автор

Map(operator.neg, reversed(range(0, 3))) ?

DrDeuteron
Автор

Be on the safer side and always use step argument

kartikeyachoudhary
Автор

I was thinking that (0, -3) will cause error

Pawlo
Автор

but why it doesn't have -3 and 3? it doesn't make sense. Also 0 is not positive or negative

XdekHckr
Автор

Range's first two arguments are lower boundary and higher boundary. So put the lower value first and higher value next. range(-3, 0)

niaei
Автор

Is there a channel like this but for C programming?

saturdaysequalsyouth
Автор

so here is a question - is the '3 how many, or is it the limit. because if it is how many, then it should be 3 (positive) in both cases and if it is the limit then the last value should be +/- 3. There no other logical answer. So yet again, Python is broken.

transientaardvark
Автор

The main thing beginners mess up is to learn python...

gro
Автор

why are people coding in python again ?

FilterChain