Skip to content

Instantly share code, notes, and snippets.

@tasfik007
Last active July 24, 2019 19:50
Show Gist options
  • Save tasfik007/8f6189a810be6e9b8ff5c90c4822c313 to your computer and use it in GitHub Desktop.
Save tasfik007/8f6189a810be6e9b8ff5c90c4822c313 to your computer and use it in GitHub Desktop.
################ method 1 ##################
import os
os.system('cls') # prints 0
tmp=os.system('cls') # avoids 0
############################################
################ method 2 ##################
import subprocess as sp
sp.call('cls',shell=True) # prints 0
tmp=sp.call('cls',shell=True) # avoids 0
############################################
print('Hello World!!')
print(12)
print("Tasfik Rahman")
print('Tasfik '+'Rahman')
##### print without new line #####
print('Tasfik Rahman',end='')
print('prints newline at the end')
# same as
print('prints newline at the end',end='\n')
# Python Snippets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment