Python Programming Cheat Sheet: Essential Syntax and Libraries

Numbers and Math

  • Arithmetic: +, -, /, // (floor), % (remainder), ** (exponent).
  • Shorthand: a += 2 (also -=, *=, //=).
  • Functions: abs(-3.5), round(3.56, 1), max(3.56, 4.57).

Strings and Formatting

  • Quotes: 'spam eggs', "doesn't".
  • Newline: print('\n').
  • F-Strings: f'Price {cost:.2f}', f'{ratio:.2%}'.

Data Types

  • int (whole), float (decimal), str (text), bool (True/False).
  • Input: input() (returns string), int(input()) (converts to integer).

Decision Making

age = int(input('Enter your age: ')) if age >= 18: print(
Read More

The Power of Humility and Collaboration in Teamwork

Humility and Collaboration in Group Work

One experience that taught me the importance of humility and collaboration was working on my final thesis project with another student. At first, I thought the biggest challenge would be organizing the research and completing all the work on time. However, I quickly realized that working closely with another person also requires patience, communication, and the ability to accept different opinions and working styles.

Bridging Different Working Styles

My partner

Read More

Statistical Analysis and Machine Learning Fundamentals

Measures of Central Tendency and Dispersion

a) Measures of Central Tendency

These metrics identify the central point of a data distribution.

  • Mean (Average): The sum of all values divided by the count.
    • Example: A retail store counts daily customers over 5 days: [10, 15, 20, 25, 30]. The Mean is (10+15+20+25+30)/5 = 20.
  • Median (Middle Value): The middle number in a sorted list. It is highly resistant to outliers.
    • Example: If software engineer salaries are [$60k, $65k, $70k, $80k, $250k], the Median is $
Read More

Key Historical Events and Medical Case Studies

Medical Case Studies

Case 1: Bicycle Accident

What happened? Ella fell off her bicycle and hurt her leg.

What was the injury? Her leg was broken.

What is the treatment? The doctor examined her, prescribed pills, applied a cast, and she used a wheelchair before using crutches.


Case 2: Sports Injury

What happened? He had an accident while playing soccer.

What was the injury? He hurt his back and shoulder.

What is the treatment? Paramedics arrived in an ambulance and took him to the emergency room.


Case 3:

Read More

Neural Network Architectures and Learning Algorithms

Convolutional Neural Networks (CNN)

CNN is a deep learning model mainly used for processing image data. It automatically extracts features such as edges, textures, and shapes from images.

CNN Architecture

Input Image
|
Convolution Layer
|
Activation (ReLU)
|
Pooling Layer
|
Convolution + Pooling
|
Fully Connected Layer
|
Output Layer

Working of CNN

  1. Input Layer: Receives the image.
  2. Convolution Layer: Extracts features using filters.
  3. ReLU Layer: Introduces non-linearity.
  4. Pooling Layer: Reduces image dimensions.
  5. Fully
Read More

Building a React Pokémon and Item Browser with Next.js

Project Structure

This documentation covers the implementation of a Pokémon and Item browser using React, TypeScript, and the PokeAPI.

Core Components

  • PokemonsPage: Fetches and displays a paginated list of Pokémon.
  • ItemsPage: Fetches and displays a paginated list of game items.
  • PokemonCard & ItemCard: Reusable components for displaying entity details.
  • Paginador: A navigation component for handling API pagination.

Implementation Details

The application utilizes useEffect and useState to manage data

Read More

Electrical Instrumentation and Measurement Principles

Strain Measurement with Strain Gauges

A strain gauge is a resistive transducer that changes its electrical resistance in proportion to the mechanical strain applied to it.

Principle and Gauge Factor

When a conductor is stretched, its length increases and diameter decreases, both of which increase resistance (R = ρL/A). The Gauge Factor (GF) is defined as: GF = (∆R/R) / (∆L/L) = (∆R/R) / ε, where ε is strain. For metallic gauges, GF ≈ 2; for semiconductor gauges, GF = 100–150.

Wheatstone

Read More

Indian Monsoon Dynamics and Water Conservation Strategies

Indian Monsoon Dynamics and Types

The monsoon refers to the seasonal reversal of winds associated with rainfall. India experiences a monsoon climate which strongly influences its agriculture and economy.

Types of Monsoon

  • Southwest Monsoon: Occurs from June to September. Moisture-laden winds from the Indian Ocean provide the major portion of rainfall.
  • Northeast Monsoon: Occurs during October to December. It mainly affects southeastern India and is important for southern agriculture.

Factors Affecting

Read More

Human Values and Ethics: Principles for a Balanced Life

1. Meaning of Human Values

At its core, a human value is anything that allows a human being to live in harmony with themselves, other people, and nature. The word “value” refers to the participation or role of an element in a larger system. For example, the value of a pen is to write; the value of a steering wheel is to guide a car. Similarly, the value of a human being is the behavior and mindset that fosters mutual happiness in relationships and balance in society.

  • Examples include honesty, trust,
Read More

Extraterritorial Jurisdiction and ECHR Human Rights Cases

State Invasion and Effective Jurisdiction

When a State invades another and commits human rights violations in that territory, the ECHR may still apply if the invading State is deemed to exercise “effective jurisdiction” over the occupied area. This has been confirmed by the ECtHR in multiple cases (such as Loizidou v. Turkey, concerning the occupation of northern Cyprus).

Article 1 of the Convention requires States to respect the rights of everyone within their jurisdiction. Although jurisdiction

Read More