Created
February 28, 2018 23:05
-
-
Save enseitankad0/2bd10afa9d8c7be4611a7e4b705f0fa9 to your computer and use it in GitHub Desktop.
This file contains 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
# this is a test line in project 2 | |
string1 = 'this as the same' | |
string2 = "as below" | |
print(string1 +" " + string2) | |
# print(string1) | |
print(string1[0]) # [t] his is as the same... | |
print(len(string1)) | |
print(string1[-1]) # this is as the sam[e]... | |
# string[-2]='x' --> error, string is not mutable | |
print(string1[:5]) ## -> "this" | |
print(string1[10:]) ## -> "e same" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment