Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
joas18915yI hate code that's not verbose. I understand it if it's implementing a mathematical algorythm, but commonly it's just better read if it's written without abbreviation and shorted words.
-
It looks like a stupid way to handle command line arguments.
I would use the built in libraries for command line args: https://docs.python.org/3.7/...
It will produce much cleaner code. -
retnikt67745yt_itr is just a name like I j or k. You can put anything you want there as long as it's a valid name and it wont change anything
-
It looks like a form of Hungarian Notation. It's fallen out of favor, but I agree with Joel Spolsky that that's because most people did it wrong.
Here's his article on doing it right: https://joelonsoftware.com/2005/05/... -
solis485yIt's HackerRank. Solutions are usually set up by default with I/O and some variables that get fed into a solution function.
Up to Python 2, range creates a list. In Python 3, it creates an iterator. The for syntax here simply iterates through an iterable's iterator. So the variable there just holds the value returned from the iterator per iteration. -
asgs112785y@ajay06 no, itr is a very common short form of iterator
But it doesn't matter what it means when the author couldn't be bothered
While I'm doing my hacker rank problem I have seen new word instead of using letter like I,j,k .but it is weired .Can I just know what is t_itr is that has any operation? In for loop "for "t_itr" in range t"
question