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

Add Days To A Date In Python Using Loops, Ranges, And Slicing

I'm a beginner in python and I've recently learned how to do the basics of: functions, loop… Read more Add Days To A Date In Python Using Loops, Ranges, And Slicing

Python Time Range Validator

I have 2 parameters in DB: start and stop. value for them can be eg 07:00-23:00 or 23:00-07:00 (st… Read more Python Time Range Validator

How Can I Pass Infinity To Redis From Python?

I'm using redis-py and want to use -inf and inf with ZRANGEBYSCORE. I tried to do this using s… Read more How Can I Pass Infinity To Redis From Python?

Should I Cache Range Results If I Reuse Them?

I'm relatively new to python, and I'm trying to optimize some code for a HackerRank problem… Read more Should I Cache Range Results If I Reuse Them?

Change Step Value Inside Range Function?

list1 = [1, 2, 3, 4] i'm trying to figure out a way to change the step value for each printed … Read more Change Step Value Inside Range Function?

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

Is It Possible To Implement A Python For Range Loop Without An Iterator Variable?

Is it possible to do following without the i? for i in range(some_number): # do something If y… Read more Is It Possible To Implement A Python For Range Loop Without An Iterator Variable?

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?