<jupyter_start><jupyter_text>String literals in python are surrounded by either single quotation marks, or double quotation marks. 'hello' is the same as "hello". You can display a string literal with the print() function:<jupyter_code>"hello"
'hello'
type("hello")<jupyter_output><empty_output><jupyter_text>string Creation using * operator<jupyter_code>string_a = 'a' * 10
string_ab = 'ab' * 10
string_aba = 'aba ' * 10
print(string_a)
print(string_ab)
print(string_aba)<jupyter_output>aaaaaaaaaa
abababababababababab
aba aba aba aba aba aba aba aba aba aba<jupyter_text>Multiline Strings* You can assign a multiline string to a variable by using three quotes:<jupyter_code>string = """Hey, you !
    Haan, you.
    Whrere are you looking at ?
    Do Python Everyday.
    You cant just see and learm python.
    You need to practice it everyday...
    Solve basic problems as you did in C, C++
    the nmove towards larger problems
"""
print(string)<jupyter_output>Hey, you !
    Haan, you.
    Whrere are you looking at ?
    Do Python Everyday.
    You cant just see and learm python.
    You need to practice it everyday...
    Solve basic problems as you did in C, C++
    the nmove towards larger problems<jupyter_text>INDICES<jupyter_code>string = "<NAME>"
print(string[0])
print(string[1])
print(string[2])
print(string[3])
print(string[4])
print(string[5])
print(string[6])
print(string[7])
print(string[8])
print(string[9])
print(string[10])<jupyter_output>H
e
l
l
o
 
W
o
r
l
d<jupyter_text>Reverse indices starts from -1<jupyter_code>string = "Hello World"
print(string[-1])
print(string[-2])
print(string[-3])
print(string[-4])
print(string[-5])
print(string[-6])
print(string[-7])
print(string[-8])
print(string[-9])
print(string[-10])<jupyter_output>d
l
r
o
W
 
o
l
l
e<jupyter_text>substring<jupyter_code>string
string[2:5]
string[:]
string[4:]
string{:4}
string
string[0:4}<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12181155648099948, 'fraction_numerical': 0.018740239458615304, 'mean_word_length': 5.364238410596027, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '340250', 'license': 'MIT', 'n_tokens_mistral': 723, 'n_tokens_neox': 700, 'n_words': 201, 'path': '03. String Handling/1. What is string String operations and indices.ipynb', 'repo_name': 'penanrajput/PythonCourseContent', 'size': '1926'}