<jupyter_start><jupyter_text>string literals before 3.6<jupyter_code>name='charan'

print('My name is {}'.format(name))<jupyter_output>My name is charan<jupyter_text>after 3.6<jupyter_code>print(f'My name is {name}')
Person = [('Name','Age','Gender'),('Charan',23,'M'),('Ramya',22,'F'),('Srikanth',25,'M'),('Priya',23,'F'),('Gayu',23,'F')]
print(Person)
Person<jupyter_output>[('Name', 'Age', 'Gender'), ('Charan', 23, 'M'), ('Ramya', 22, 'F'), ('Srikanth', 25, 'M'), ('Priya', 23, 'F'), ('Gayu', 23, 'F')]<jupyter_text>Printing using string literals<jupyter_code>for Name,Age,Gender in Person:
    print(f'{Name:15} {Age:>10} {Gender:10}')<jupyter_output>Name                   Age Gender    
Charan                  23 M         
Ramya                   22 F         
Srikanth                25 M         
Priya                   23 F         
Gayu                    23 F<jupyter_text>Printing datetime using string literals<jupyter_code>import datetime

today=datetime.datetime(1997,12,3)
today
print(f'{today}')
# get diff modes of date from strftime.org
print(f'{today:%B %d,%Y}')<jupyter_output>December 03,1997<jupyter_text>writing and reading a file<jupyter_code>%%writefile test.txt
Hello, I am Charan.
You there.
file=open('test.txt','r')
file
file.read()
file.seek(0)
content = file.read()
content
content
file.close()
file=open('test.txt')
mylines=file.readlines()
for line in mylines:
    print(line)
file.close()
with open('new.txt','a+') as f:
    f.write('This is new file')
new_file=open('new.txt')
print(new_file.read())<jupyter_output>This is new fileThis is new file
{'fraction_non_alphanumeric': 0.1776937618147448, 'fraction_numerical': 0.034026465028355386, 'mean_word_length': 4.189542483660131, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '207057', 'license': 'MIT', 'n_tokens_mistral': 649, 'n_tokens_neox': 590, 'n_words': 124, 'path': 'Codes/UdemyCourseCodes/Practice/01_PythonTextBasics/01_pythonTextBasics.ipynb', 'repo_name': 'NoobyCoders1289/NlpProjects', 'size': '1587'}