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?