Bitwise-Operators

Wed 12 November 2025
#  created : 20250113
#  https://www.scientecheasy.com/2022/10/bitwise-operators-in-python.html/
#  https://chatgpt.com/share/678524a9-cd24-8012-a475-2b7098cd8750
# Bitwise Operators in Python
# &     Bitwise AND                 Binary
# |     Bitwise OR                  Binary
# ^     Bitwise XOR (Exclusive OR)  Binary
# ~     Bitwise NOT                 Unary
# <<    Bitwise Left Shift          Binary
# >>    Bitwise Right Shift         Binary
# Bitwise AND operator (&)
A = 2
B = 6
result = A …

Category: python-basics

Read More

Break-Statement

Wed 12 November 2025
#  created : 20250316
#  https://www.scientecheasy.com/2022/11/break-statement-in-python.html/
# Example Program based on Break
# Use of break statement inside the for loop.
for x in range(1, 11):
    if x == 5:
        break # Breaking a loop.
    print("X = ",x)
X =  1
X =  2
X =  3
X =  4
# Use of break …

Category: python-basics

Read More

Calling-A-Function

Wed 12 November 2025
#  created : 20250321
#  https://www.scientecheasy.com/2022/12/calling-a-function-in-python.html/
# Execution Style of Calling a Function in Python
# Function definition.
def funct_name(): # function header.
    print('This function does not contain any parameter.')
# Main program execution started from here.
funct_name() # function calling.
This function does not contain any parameter.
# Function definition …

Category: python-basics

Read More

Class-Docstring

Wed 12 November 2025
#  created : 20250113
#  https://www.scientecheasy.com/2022/09/docstring-in-python.html/
#  class docstring
class Rectangle:
    """
    This is a class for calculating the area of a rectangle.

        Parameters:
        l (int) : The length of rectangle.
        b (int) : The breadth of rectangle.
    """
print(Rectangle.__doc__)
    This is a class for calculating the area of …

Category: python-basics

Read More

Class-Keyword

Wed 12 November 2025
#  created : 20250111
#  https://www.scientecheasy.com/2022/09/reserved-keywords-in-python.html/
#  class Keyword
#  example for a class declarstion 
class ClassExample:
    def func1(parameters):
        . . . .
    def func2(parameters):
        . . . .
with open('myfile.txt', 'w') as file:
    file.write('Hi jerin!')
#  as Keyword
import math as x
print(x.cos(0))
1.0
#  pass keyword …

Category: python-basics

Read More

Class-Object

Wed 12 November 2025
class Car:
    def __init__(self, brand, model):
        self.brand = brand
        self.model = model

    def display_info(self):
        print(f"Car Brand: {self.brand}, Model: {self.model}")


my_car = Car("Toyota", "Corolla") # ---> this is the object for that class
my_car.display_info()
Car Brand: Toyota, Model: Corolla


Score: 0

Category: python-basics

Read More

Collection-Literals

Wed 12 November 2025
#  created : 20250112
#  https://www.scientecheasy.com/2022/09/literals-in-python.html/
#  Collection literals in Python

#  List literals
address = ['Scientech Easy', 'Joraphatak Road', 'Dhanbad']
print(address)
['Scientech Easy', 'Joraphatak Road', 'Dhanbad']
num = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
print(num)
[1, 2, 3, 4, 5, 6, 7, 8 …

Category: python-basics

Read More

Comparison-Operators

Wed 12 November 2025
#  created : 20250113
#  https://www.scientecheasy.com/2022/10/comparison-operators-in-python.html/
#  Comparison  Operators
# Equal to (==)
x = 20
y = 20
print( x == y)
True
p = 'My name is John'
q = 'My name is John'
print( p == q)
True
r = 'Text'
s = 'text'
print( r == s)
False
t = [1, 2, 3, 4]
u …

Category: python-basics

Read More

Continue-Statement

Wed 12 November 2025
#  created : 20250316
#  https://www.scientecheasy.com/2022/11/python-continue.html/
# Syntax of Continue Statement in Python
for letter in 'Technology':
    if letter == 'n':
        print('Skipping the loop at', letter)
        continue
    print(letter)
T
e
c
h
Skipping the loop at n
o
l
o
g
y
for x in range …

Category: python-basics

Read More

Correlation-1

Wed 12 November 2025
import pyutil as pyu
pyu.get_local_pyinfo()
'conda env: py311; pyv: 3.11.9 (main, Apr 19 2024, 16:48:06) [GCC 11.2.0]'
print(pyu.ps2("pandas"))
pandas==2.2.3
# necessary modules
import pandas as pd
import numpy as np
def histogram_intersection(a, b):
    v = np.minimum(a …

Category: pandas-work

Read More
Page 2 of 10

« Prev Next »