Skip to content

Instantly share code, notes, and snippets.

@MishraKhushbu
Last active April 10, 2019 08:17
Show Gist options
  • Save MishraKhushbu/870b142403d9f2479e1858aa9013c9c6 to your computer and use it in GitHub Desktop.
Save MishraKhushbu/870b142403d9f2479e1858aa9013c9c6 to your computer and use it in GitHub Desktop.
Learn_Python_The_hard_way
If you are using python 2, then you can add a comma after the print function like this:
for i in range(10):
print i, # <- notice the comma at the end
will output:
0 1 2 3 4 5 6 7 8 9
In python 3, print is now a function and will take an argument, called end like this:
print(i, end = " ")
What’s the difference between argv and raw_input()?
The difference has to do with where the user is required to give input. If they give your script
inputs on the command line, then you use argv. If you want them to input using the keyboard
while the script is running, then use raw_input().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment