<jupyter_start><jupyter_text>Basic Python<jupyter_code># Display something on screen

print("Test message")

# It also works with many data types

print(5)
print(True)
# Variables in python

new_variable = 5 # In python you don't need to specify the type of variable

# Check the type of variable
print(type(new_variable))

float_variable = 5.0
print(type(float_variable))<jupyter_output><class 'int'>
<class 'float'><jupyter_text>Math operations- `a + b` - add- `a - b` - substract- `a * b` - multiply- `a / b` - division- `a // b` - floor division- `a % b` - modulus, remainder from division- `a ** b` - power  Strings<jupyter_code>character_name = "Ram"

print("My name is " + character_name + "\nand I am awesome") # '\n' means end-of-line (see below)
# Concatenation

phrase = "<NAME>"
print(phrase + " and <NAME>")

# If you want to print many variables in formatted way it's better to use `format` method

print("My favourite {0}'s movies are {1} and {2}".format("Monty Python", "Holy Grail", "Life of Brain"))

# `format` method has also more awesome features
## Converting to upper case

print(phrase.upper())

# And check if it so

print(phrase.upper().isupper())

# Length of the string

print(len(phrase)) # You can use `len` method with many data type. But what if you pass an integer inside brackets?<jupyter_output><NAME>
True
12<jupyter_text>If you checked result of len function with an integer you should have seen error message in Python. You should not be scared of this view, it mostly gives you a precise information what was wrong with code. You can see at the same bottom error message that there was a TypeError<jupyter_code># Print a particular letter
# Indexing in python starts with zero

print(phrase[0]) # At what index is letter 'e'?

## To know where the index is starting from

print(phrase.index("Pott"))
# To replace a letter

print(phrase.replace("Harry","Sorry"))
# Adressing numbers 

print(3.0+4.56)
# Convert number to string 
number = 5
print(type(number))
print(type(str(number)))
# Concatenating 
print(str(number)+" is my favourite number")
# importing math library
import math

# Check what's inside of this library
dir(math)
# Taking sqaure root
print(math.sqrt(4.7))
# Rouding off number to its maximum
print(math.ceil(3.4))
# Rounding of number to its minimum
print(math.floor(3.4))<jupyter_output>3
{'fraction_non_alphanumeric': 0.11333617383894333, 'fraction_numerical': 0.0097997443544951, 'mean_word_length': 4.754901960784314, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '595416', 'license': 'Apache-2.0', 'n_tokens_mistral': 761, 'n_tokens_neox': 737, 'n_words': 294, 'path': 'Python-Tutorial_01.ipynb', 'repo_name': 'iOmbre/python-awesome', 'size': '2364'}