0

Can any one tell me how i make a own range function in define?

I am Aakash and I am too confused how make own range function in Python can anyone tell me how i can make it

8th Nov 2017, 7:10 PM
Aakash Sharma
Aakash Sharma - avatar
3 Respuestas
+ 9
# I'd go like this: def xrange(start, stop, step=1): i = start while i < stop: yield i i += step print(list(xrange(0, 30, 4)))
8th Nov 2017, 5:56 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 7
There, I made it into a [PythonEdu] code. Check out the comments inside: https://code.sololearn.com/co4tk353axjg/?ref=app
8th Nov 2017, 6:44 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
0
okay but i did it. can you explain the everything in English.
8th Nov 2017, 5:58 PM
Aakash Sharma
Aakash Sharma - avatar