Last active
June 24, 2018 17:04
-
-
Save rashedulemon/2c12163120e4a5ed0b051eb2e3ce502e to your computer and use it in GitHub Desktop.
This is a program which is show how slice orerator([] and [:]) work.
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
| S1 = "Hello Python" | |
| print(S1) # Prints complete string | |
| print(S1[0]) # Prints first character of the string | |
| print(S1[2:5]) # Prints character starting from 3rd t 5th | |
| print(S1[2:]) # Prints string starting from 3rd character | |
| print(S1 * 2) # Prints string two times | |
| print(S1 + "Thanks") # Prints concatenated string |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment