(SEM III) THEORY EXAMINATION 2023-24 PYTHON PROGRAMMING

B.Tech Python Programming 0 downloads
₹29.00

This examination evaluates a student’s conceptual understanding and programming ability in Python, covering core syntax, functions, file handling, data visualization, loops, strings, lists, numerical computing, and problem-solving skills.

The paper is divided into three sections, progressively testing basic concepts, applied programming, and advanced logic-building.

SECTION A – Short Answer Questions (14 Marks)

7 questions × 2 marks

This section checks essential, fundamental Python concepts that form the base for programming and data processing.

Topics Covered:

1. List Comprehension

Understanding how lists are created in a single line using expressions and iteration.

2. Difference Between / and // Operators

Floating-point division vs floor division with examples.

3. Output Prediction

Given a function involving .split() and join(), students predict final output.

4. Using Functions From Another File (module import)

How main.py accesses functions defined in library.py using import, from ... import, and module references.

5. Difference Between linspace and arange

Numerical range generation in NumPy for plotting and mathematical applications.

6. Error Identification in List/String Operations

Mutability vs immutability: why modifying a string index fails.

7. Functions of Matplotlib & Pandas

Basic plotting commands, data structures, and operations.

This section judges clarity of Python fundamentals and error understanding.

SECTION B – Applied Python Programming (21 Marks)

Attempt any 3 questions – each 7 marks

This section requires writing Python programs, demonstrating logic, and implementing operations on data structures, files, and functions.

Questions Cover:

1. Unpacking Tuples, Mutable Sequences & String Concatenation

Explaining with code how tuple unpacking works, modifying elements in lists, and joining strings.

2. List Slicing Operations

Performing multiple slicing tasks on a list, such as:
• reverse slices
• mid-segment extraction
• even-index elements
• reversing part of a list
• dividing and replacing elements

3. Perfect Square Function

Implementing perfect_square(number) that returns the number only if a perfect square; otherwise returns −1.

4. File Handling – Reverse Characters With Commas

Reading a file and rewriting content as comma-separated characters:
Example: "Hello!!" → "H,e,l,l,o,!,!"

5. Plotting Dataset Using Matplotlib

Constructing bar/line plots for calories, potassium, and fat from given food dataset.

This section evaluates programming fluency, slicing, iteration, logic writing, and basic data visualization.

SECTION C – Logical & Real-World Python Applications (35 Marks)

Each section contains two options; students attempt ONE.

3. String Manipulation & Sorting (7 Marks)

Option A – removenth(s, n)

Function to remove the nth character from a string, handling edge cases when n ≥ len(s).

Option B – Sorting comma-separated words

Program to accept input like:
without, hello, bag, world
Sort alphabetically and print result.

4. Password Validation or Loop Demonstrations (7 Marks)

Option A – Password Validator

Program enforcing:
✓ lowercase letter
✓ uppercase letter
✓ digit
✓ special char ($#@)
✓ length 6–12
Valid passwords printed comma-separated.

Option B – Demonstrate While & For Loops

Explanation with practical examples on iteration, termination, nested loops, and range usage.

5. Nested Lists & Text Filtering (7 Marks)

Option A – Smallest List Finder

Function ret_smaller(l) returning list with smallest length; ties resolved by first occurrence.

Option B – Text Filters

Filtering rules:

extract numbers

extract strings starting with vowels

extract strings containing nouns (Agra, Ramesh, Tomato, Patna)

Used to clean messy text through Python list comprehensions and filters.

6. File Processing & Digit-only Words (7 Marks)

Option A – Convert Numbers to Words in File

Program reads text and replaces numeric digits with word equivalents inside the file.

Option B – Extract Digit-only Words

Program reading a file and printing only those words composed purely of digits.

7. CSV Processing & Calculator App (7 Marks)

Option A – Process cities.csv

Tasks:
• read CSV
• remove last column → store in one array
• store last column separately
• plot first two columns using matplotlib

Option B – Build a Simple Calculator

Buttons/functions:

addition
– subtraction
× multiplication
÷ division
C clear
Python implementation using functions or GUI (Tkinter).

Purpose of This Examination

This exam ensures that students can:

Use Python for solving computational problems
Implement functions, loops, slicing, and data structures
Perform file handling, string manipulation, and data cleaning
Visualize data using matplotlib
Work with CSV files and external modules
Understand program errors and fix them
Apply logic to real-world tasks like password validation and text filtering
Build structured, reusable Python programs

This paper strengthens student ability to think algorithmically and apply Python in practical domains including data science, automation, and application development.

File Size
199.47 KB
Uploader
SuGanta International
⭐ Elite Educators Network

Meet Our Exceptional Teachers

Discover passionate educators who inspire, motivate, and transform learning experiences with their expertise and dedication

KISHAN KUMAR DUBEY

KISHAN KUMAR DUBEY

Sant Ravidas Nagar Bhadohi, Uttar Pradesh , Babusarai Market , 221314
5 Years
Years
₹10000+
Monthly
₹201-300
Per Hour

This is Kishan Kumar Dubey. I have done my schooling from CBSE, graduation from CSJMU, post graduati...

Swethavyas bakka

Swethavyas bakka

Hyderabad, Telangana , 500044
10 Years
Years
₹10000+
Monthly
₹501-600
Per Hour

I have 10+ years of experience in teaching maths physics and chemistry for 10th 11th 12th and interm...

Vijaya Lakshmi

Vijaya Lakshmi

Hyderabad, Telangana , New Nallakunta , 500044
30+ Years
Years
₹9001-10000
Monthly
₹501-600
Per Hour

I am an experienced teacher ,worked with many reputed institutions Mount Carmel Convent , Chandrapu...

Shifna sherin F

Shifna sherin F

Gudalur, Tamilnadu , Gudalur , 643212
5 Years
Years
₹6001-7000
Monthly
₹401-500
Per Hour

Hi, I’m Shifna Sherin! I believe that every student has the potential to excel in Math with the righ...

Divyank Gautam

Divyank Gautam

Pune, Maharashtra , Kothrud , 411052
3 Years
Years
Not Specified
Monthly
Not Specified
Per Hour

An IIT graduate having 8 years of experience teaching Maths. Passionate to understand student proble...

Explore Tutors In Your Location

Discover expert tutors in popular areas across India

Singing & Guitar Classes Near By Tilak Nagar Professional Music Training for Beginners & Advanced Learners Tilak Nagar, Delhi
Yoga Classes Near Saket – Transform Your Mind, Body & Lifestyle Saket, Delhi
Yoga Classes Near Saket Transform Your Mind, Body & Lifestyle with Professional Yoga Training in 2026 Saket, Delhi
Yoga Classes Near By Lajpat Nagar Build Strength, Reduce Stress & Achieve Holistic Wellness in 2026 Lajpat Nagar, Delhi
Financial Advisor Near Sector 104 Gurugram (Dwarka Expressway) – Smart Planning for a Secure Future Dwarka Expressway in Sector 104, Gurugram
Web Development Classes Near Uttam Nagar – Learn to Build Modern Websites Uttam Nagar, Delhi
Legal Documentation Assistance Near By Dwarka Mor Reliable, Accurate & Professional Legal Drafting Dwarka Mor, Delhi
Zumba Classes Near Sector 133 Greater Noida – Fun, Fitness and Energy in Every Step Noida
Spoken English Classes Near By Vasant Vihar Improve Fluency, Build Confidence & Achieve Career Success in 2026 Vasant Vihar, Delhi
Guitar Classes Near DLF Phase 1 – Learn Guitar from Expert Teachers DLF Phase I, Gurugram
Hindi Classes Near Sector 89 Gurugram – Build Language Skills with Confidence and Clarity Sector 89, Gurugram
Spoken English Classes Near By Kalkaji Improve Fluency, Build Confidence & Grow Career Opportunities in 2026 Kalkaji, Delhi
Yoga Classes Near Sector 138 Greater Noida – Improve Health, Mind & Lifestyle Through Professional Yoga Training Noida
Japanese Language Classes Near Uttam Nagar – Learn Japanese for Global Opportunities Uttam Nagar, Delhi
Piano Classes Near Tilak Nagar – Learn, Play & Master Music with Confidenc Tilak Nagar, Delhi
Digital Marketing Classes Near Noida Sector 98 – Learn Modern Marketing Skills and Build a Successful Career Expressway, Sector 98, Noida, Noida
Spoken English Classes Near By Tilak Nagar Improve Fluency, Build Confidence & Unlock Career Opportunities in 2026 Tilak Nagar, Delhi
Public Speaking Training Near Uttam Nagar – Speak with Confidence & Impact Uttam Nagar, Delhi
Tally / Accounting Software Classes Near By Kirti Nagar – Become a Skilled Accounts Professional Kirti Nagar, Delhi
Zumba Classes Near Malviya Nagar – Dance Your Way to Fitness & Confidence Malviya Nagar, Delhi
⭐ Premium Institute Network

Discover Elite Educational Institutes

Connect with top-tier educational institutions offering world-class learning experiences, expert faculty, and innovative teaching methodologies

Réussi Academy of languages

sugandha mishra

Réussi Academy of languages
Madhya pradesh, Indore, G...

Details

Coaching Center
Private
Est. 2021-Present

Sugandha Mishra is the Founder Director of Réussi Academy of Languages, a premie...

IGS Institute

Pranav Shivhare

IGS Institute
Uttar Pradesh, Noida, Sec...

Details

Coaching Center
Private
Est. 2011-2020

Institute For Government Services

Krishna home tutor

Krishna Home tutor

Krishna home tutor
New Delhi, New Delhi, 110...

Details

School
Private
Est. 2001-2010

Krishna home tutor provide tutors for all subjects & classes since 2001

Edustunt Tuition Centre

Lakhwinder Singh

Edustunt Tuition Centre
Punjab, Hoshiarpur, 14453...

Details

Coaching Center
Private
Est. 2021-Present
Great success tuition & tutor

Ginni Sahdev

Great success tuition & tutor
Delhi, Delhi, Raja park,...

Details

Coaching Center
Private
Est. 2011-2020