Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

Python programming notes basic to advanced

Rating
-
Sold
-
Pages
179
Uploaded on
01-10-2025
Written in
2025/2026

These are notes for python programming language from basic to advanced. Each topic includes it's concept, 20 questions, 20 mcqs , and some quizzes

Institution
Course

Content preview

Tab 1

,📘 Python Handbook — Chapter 1
Introduction, Setup, First Programs




1.1 What is Python?
Python is a high-level, interpreted, general-purpose programming language.

●​ High-level: you write instructions close to human language, not machine code.​

●​ Interpreted: you don’t compile it manually — Python’s interpreter reads and runs
your code line by line.​

●​ General-purpose: not limited to one domain. You can build web apps, AI,
automation scripts, data pipelines, games, etc.​




1.2 Installing Python
●​ Windows: download from python.org. During install, check ✅ “Add Python to
PATH”.​


Linux/Mac: usually pre-installed; check with:​

python3 --version

●​ If missing, install with package manager (sudo apt install python3).​




1.3 Writing First Program
You can use:

REPL (Read–Eval–Print Loop): type python3 in terminal → interactive mode.​

>>> print("Hello World")
Hello World

, 1.​ Each line is executed immediately.​


Script mode: save file first.py with:​

print("Hello World")
Run:​

python3 first.py

2.​




1.4 Printing Multiple Lines
Python supports triple quotes (''' or """) for multi-line strings.

Code (Problem1.py):

print('''Twinkle Twinkle little star
How I wonder what you are
Up above the world so high
Like a diamond in the sky''')


Explanation:

●​ print() outputs text to console.​

●​ '''...''' keeps newlines and formatting exactly as typed.​


Output:​

Twinkle Twinkle little star
How I wonder what you are
Up above the world so high
Like a diamond in the sky

●​

Logic: instead of writing multiple print() statements, triple quotes let you print a whole
block.

, 1.5 Comments
Lines starting with # are comments. They don’t run, but explain code.

# This program was done using REPL


Use comments for documentation, debugging, or reminders.




1.6 Text-to-Speech Example
Code (Problem3.py):

import pyttsx3


engine = pyttsx3.init() # initialize TTS engine
engine.say("Hey I am good") # queue text
engine.runAndWait() # process and speak


Explanation:

●​ import pyttsx3: loads text-to-speech library.​

●​ init(): sets up engine with default driver.​

●​ say(): queue text.​

●​ runAndWait(): actually speaks text and waits until finished.​


Logic flow:​
Program imports → initializes → queues → speaks.

Practice exercise: Modify to read a poem aloud.




1.7 Listing Files in Directory
Code (Problem4.py):

import os

Written for

Course

Document information

Uploaded on
October 1, 2025
Number of pages
179
Written in
2025/2026
Type
Class notes
Professor(s)
Krishna
Contains
All classes

Subjects

$5.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
krishnapassi

Get to know the seller

Seller avatar
krishnapassi Sri Aurobindo college
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
7 months
Number of followers
0
Documents
1
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions