#--------------------------------
#IMPORTING LIBRARIES
#--------------------------------
import pandas as pd # Manipulation of data structures like
DataFrame and Series
import numpy as np # the core library for numerical and
scientific computing
#---------------------------------
#PRINTS THE QUOTED TEXT
#--------------------------------
print("Hello, World!") # simply prints the text in the paranthesis
#---------------------------------
#GETS INPUT AND PRINTS
#---------------------------------
name = input("Enter your name: ") # gets an input and store in a string variable
name
print("Hello", name) # prints the name followed by hello
#-----------------------------------------------------
# GETS NUMERICAL USER INPUT FOR EVEN OR ODD PREDICTION
#-----------------------------------------------------
num = int(input("Enter a number: ")) # gets a number and store in variable num
if num % 2 == 0: # IF CONDTION check if the modular value is zero if
yes process the
print("Even Number") # further steps if No go to Else condition
else: # ELSE process the further steps
print("Odd Number")
#-----------------------------------------------
# SIMPLE OPERATIONS
#-----------------------------------------------
a = int(input("Enter first number: ")) # gets an user input and stores in the
variable a
b = int(input("Enter second number: ")) # gets an user input and stores in the
variable b
print("Addition =", a + b) # basic operations like Addition, Subraction,
Mutiplication and Division will be performed
print("Subtraction =", a - b) # with the value stored in a and b and prints
the output.
print("Multiplication =", a * b) # NOTE: We can also directly assign the value
to the variable like a=5, b=10 and perform the operations
print("Division =", a / b)
#-----------------------------------------------
# FOR LOOP
#-----------------------------------------------
for i in range(1, 6): # LOOPING will process the step [Link] times or
until the condition is met
print("Number:", i) # here we have asked to print the number
starting from 1 and upto 6. This code
# prints the number 1 as the start value (if not
mentioned it will consider 0 as start value)
# prints up to 5 as 1,2,3,4,5 as the range shown is 6
so the process will end before 6
#-----------------------------------------------
#FOR LOOP IN ARRAY
#-----------------------------------------------
fruits = ["apple", "banana", "mango"] # array declared in variable fruits
for f in fruits: # f will calculate the [Link] elements in arrays, each
time the loop picks 1 elements and prints it until
# all the elements are printed the loop will be
working
print(f) # prints the elements 1 by 1
#-----------------------------------------------
# WHILE LOOP
#-----------------------------------------------
count = 1 # initialize the count vaible to 1
while count <= 5: # checks the condition 1<=5
print("Count:", count) # prints the variable value
count += 1 # increments the count by 1 and checks the
condtion. the loop will continue until the condition has been
# met here the loop will work until count greater or
equal to 5 when it becomes the loop will exit
#---------------------------------------------
# FUNTION DEFINING
#--------------------------------------------
def greet(): # defining the function using function name and
we can call the fuction wherever required the particular
print("Good Morning!") # operations / set of process to be performed
greet() # calling the function
#------------------------------------------
# FUNCTION WITH ARGUMENT PASSING
#------------------------------------------
def add(a, b): # defining the function with arguments
return a + b # operations inside the function
print(add(5, 7)) # calling the function with passing arguments, the
value will be passed to the function and set of prrocess
# will be executed and prints the output.
#--------------------------------------------
# LIBRARIES IN PYTHON
#-------------------------------------------
import pandas as pd # to read dataset of any format
import numpy as np # the core library for numerical and
scientific computing
import [Link] as plt # Data Visualisation, plotting charts
import scikit-Learn as sl # library for simple and efficient tools for
classification, regression, clustering and dimensionality reduction.
import re # Library for Regex for cleaning the data
import joblib # to store the pickle file
import seaborn as sns # Data Visualisation, plotting charts
import tkinter as tk # interface to link GUI
from sklearn.model_selection import train_test_split # the train_test_split
function from scikit-learn
from sklearn.linear_model import LogisticRegression # a linear model for
binary/multiclass classification
from [Link] import accuracy_score, confusion_matrix, classification_report
# text report with precision, recall, f1-score and support for each class.
import warnings # warnings if any will be ignored
[Link]('ignore')