Skip to content Skip to sidebar Skip to footer
Showing posts with the label Range

Convert List Of Numbers To String Ranges

I'd like to know if there is a simple (or already created) way of doing the opposite of this: … Read more Convert List Of Numbers To String Ranges

How Is Irange() Any Different From Range() Or Xrange()?

I was going through Python Generators Wiki when I came across this RangeGenerator page which talks … Read more How Is Irange() Any Different From Range() Or Xrange()?

How To Do An Inverse `range`, I.e. Create A Compact Range Based On A Set Of Numbers?

Python has a range method, which allows for stuff like: >>> range(1, 6) [1, 2, 3, 4, 5] W… Read more How To Do An Inverse `range`, I.e. Create A Compact Range Based On A Set Of Numbers?

How To Check If Time Is In The Range Between Two Days?

I found some nice examples to check, if a time is in a specific range, like this one: now_time = da… Read more How To Check If Time Is In The Range Between Two Days?

Why Do I Not Have To Define The Variable In A For Loop Using Range(), But I Do Have To In A While Loop In Python?

I have the following code using a for loop: total = 0 for num in range(101): total =… Read more Why Do I Not Have To Define The Variable In A For Loop Using Range(), But I Do Have To In A While Loop In Python?

Range With Floating Point Numbers And Negative Steps

I wrote the following for creating a range with negative floating point steps: def myRange(start, s… Read more Range With Floating Point Numbers And Negative Steps