Python Basics: Operators, Logic, Loops, Strings, Functions, Lists, Dictionaries and File I/O
Python Basics, Operators, Logic and Loops
Syntax and Reading Code
Variables such as x, y, value, word, text, n, i, total, and result are ordinary variable names, not Python commands. x=5 assigns or reassigns a value, while == compares equality. Python runs statements from top to bottom, expressions follow operator precedence, and chained methods run from left to right: s.lower().title().
#starts a comment that is ignored.- Indentation groups blocks of code.
:begins anif,for,while, ordefblock.()
Introduction to Java Programming: Basics, Comments, Loops and More
Introduction to Java Programming
Basics
– Every program has a file name, and that file name must match the name of the class.
– In order for a program to execute successfully, you need to have the following lines of code after the class header:
public class Review { ← class header
public static void main(String[] args) { ← main method header
//insert code here ← your code goes inside the body of the main method
}
}
Input-Process-Output
Every program will have inputs (variable declaration
Read MorePython Programming Exercises: Practical Code Examples
Python Programming Exercises
1. Age Calculator: Year of Turning 100
Write a program that accepts a name and age, then prints the year the person will turn 100 years old.
from datetime import datetime
name = input("What is your name? ")
age = int(input("How old are you?\n"))
current_year = datetime.now().year
hundred = current_year + (100 - age)
print("Hello %s! You are %s years old. You will turn 100 years old in %s." % (name, age, hundred))2. Even or Odd Number Checker
Write a program that accepts
Read MoreComputer Networks, Database Management, and C Programming
Network Architecture
Network architecture is the design or structure of a computer network that defines how computers communicate and share resources with each other.
There are two types of network architecture:
1. Client-Server Architecture
In this architecture, one computer acts as a server and provides services and resources to other computers called clients. The server manages data, security, and other network resources. It is suitable for large organizations.
Example: A bank network where a central
Read MoreComputer Networks Exam Notes: Units I–III with Solved Numericals
Computer Networks — Exam Preparation Notes
B.Tech CSE | Minor-I | Units I, II & III
These notes are organized according to your syllabus, the two uploaded question papers, and your teacher’s exam guidelines: approximately 60% numerical/problem-solving and 40% theory.
Your preparation priority
60%
Numericals and problem-solving
Unit III routing, shortest paths and IP addressing; Unit II CRC, Hamming code, flow control and ARQ; Unit I delay calculations.
40%
Theory and diagrams
Unit I devices, transmission
Read MoreOperating Systems Key Concepts: Process States, PCB, Semaphores & Memory
Operating Systems Key Concepts: Process States, PCB, Semaphores & Memory
4. Process State & Process Control Block (PCB)
- Process States: A process cycles through: New (created) → Ready (waiting in memory) → Running (executing instructions) → Waiting/Blocked (waiting for an event/IO) → Terminated (finished execution).
- PCB Definition: A dedicated kernel data structure containing all information about a specific process.
- 5 Essential PCB Fields:
- Process State: Current condition (Ready, Running,
