Last active
December 29, 2017 07:01
-
-
Save hclpandv/93e712834faf8d08ff2dad0c647ca522 to your computer and use it in GitHub Desktop.
Python Tutorial : Essentials
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python3 | |
| print("Hello World!") | |
| user_name = input("Please Enter Your User Name: ") | |
| print("User Name Entered is " + user_name) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python3 | |
| a, b = 0, 1 | |
| if a < b: | |
| print('a ({}) is less than b ({})'.format(a, b)) | |
| #Code Blocks are called as "Suit" in Python and Python Ineterpreter Looks after ":" and | |
| #requires a consitant Indenting. | |
| #Remember : whitespaces are important and Python is case sensitive. | |
| else: | |
| print('a ({}) is Not less than b ({})'.format(a, b)) | |
| # Python Expressions may also contain conditions. example below | |
| print("Linux" if a < b else "Windows") | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python3 | |
| # |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment