Python 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,
DBMS Fundamentals: Architecture, Data Models, and SQL Languages
1. DBMS – Introduction
Data
Data means raw facts and figures.
Example: 101, Vikas, CSE, 1st Year
Database
A database is an organized collection of related data that can be easily accessed, managed, and updated.
DBMS
DBMS (Database Management System) is software used to create, store, retrieve, update, and manage data in a database.
Examples: MySQL, Oracle, PostgreSQL, SQL Server.
Functions of DBMS
- Data storage
- Data retrieval
- Data insertion and updating
- Data security
- Backup and recovery
- Concurrency control
- Integrity
Data Link Layer: Framing, ARQ, HDLC, PPP, Channel Access and Ethernet Explained
Unit 2: Data Link Layer, Complete Notes with Solved PYQs
Your exam is today, so the ★ boxes (exam-ready answers) and the PYQ solutions come first in priority. Read the basics only if you have time.
One correction to the earlier numbers: the 1 Mbps / 20 ms question has two valid answers. The textbook method (Forouzan, which the paper’s wording follows) gives 5% and 75%. The formula Tₜ/(Tₜ+RTT) gives 4.76% and 71.4%. Write the textbook method in the exam and add the formula as a one-line remark.
Read More