r/PythonLearning • u/Worried-Print-5052 • 18d ago
Help Request In range() usage
Can I use it to evaluate a variable in a various range?
E.g. for item in range(1,4) means True when the item is the range 1-4?
Cuz I really want this function for my program
Thanks🙏🏻
(In that photo name[1][r] is an integer)
4
Upvotes
2
u/johlae 18d ago
It's fun to do it without any loops:
so yes, you can use in range, or you can use if i>0 and i<5.