Skip to content
Advertisement

How do I put this into one line? [closed]

JavaScript

So I have this basic code. How could I make it into line? without including the with open, as other stuff is included later on.

I was thinking something like this xD

JavaScript

Advertisement

Answer

This can be put into one line in several ways. Without changing your code you could just remove the newline and indent:

JavaScript

Or just using unpacking and print formatting:

JavaScript

Which can also be done in one line:

JavaScript

That said, this is not a good code design choice. Making things more conscience can (at times) make it less readable.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement