0

What to do to use range function include the second argument?

If we use range() with 2 arguments and print it, it will show us a list including from the first arg. until one before the second arg. For Example: print(list(range(2,5))) Output: [2,3,4] What to do if we want to include the second arg?

26th Mar 2018, 7:46 PM
Ethan
Ethan - avatar
1 Antwort
+ 4
Add 1: range(2, 5+1)
26th Mar 2018, 7:49 PM
TurtleShell
TurtleShell - avatar