0% found this document useful (0 votes)
4 views2 pages

Is 121 Introduction To Programming Python Lab 2

The document contains lab questions for ISI 21: Fundamentals of Computer Programming for the 2024/2025 academic year. It includes tasks related to variable name classification, program writing for input handling, student information display using different formatting methods, and debugging code with logical errors. Additionally, it features analysis questions regarding code snippets and type conversion in Python.

Uploaded by

meetmichael55
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Is 121 Introduction To Programming Python Lab 2

The document contains lab questions for ISI 21: Fundamentals of Computer Programming for the 2024/2025 academic year. It includes tasks related to variable name classification, program writing for input handling, student information display using different formatting methods, and debugging code with logical errors. Additionally, it features analysis questions regarding code snippets and type conversion in Python.

Uploaded by

meetmichael55
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

ISI 21: Fundamentals of Computer Programming

2024/2025 LAB Questions - SET 2 23rd December 2025

Note: You can use a Python IDLE or Visual Studio Code IDE that can run
Python code. (Make sure to bring a hard copy of these questions to our lab
session.)

Question 1
Classify the following variable names as VALID or INVALID. For invalid
names, state which rule they violate:
_student_name 2nd_value total-score
class FirstName my variable
AGE import student123
$amount

Question 2
Write a program that:
1. Accepts three values (name, age, city) in a single input line separated by
commas
2. Splits the input into separate variables
3. Converts age to integer
4. Prints: "Name: [name] | Age: [age] years | City: [city]"

Question 3
Create a program that displays student information in different formats:
Part A: Using f-strings, display:
• Student name (left-aligned, width 15)
• Score (right-aligned, width 10, 2 decimal places)
• Percentage (center-aligned, width 12, with % symbol)
• Pass/Fail status based on score > 50
Part B: Using [Link]() method, create the same output as Part A.
Compare the readability and complexity of both methods in a comment.
Question 4
The following program has logical errors. Identify and fix them:

Question 5
Analyze this code snippet and answer the questions:

1. What is the value of z and why?


2. What is the value of a and why?
3. What would happen if we tried x + y without type conversion?

You might also like