CODEGEAR CLUB — PYTHON TRAINING
Day 1 Assignment: Output, Variables, and Data Types
Assignment Questions
Question 1: Hello World & Text Output
Write a Python script that outputs the following two lines of text to the terminal using the print()
function:
Hello, CodeGear Club!
I am excited to learn Python programming.
Question 2: Variable Creation & Data Types
Declare four separate variables in Python adhering strictly to the specifications below:
• student_name: A string variable containing your full name.
• matric_number: An integer variable containing a 6-digit matriculation number.
• gpa: A floating-point variable containing your current GPA (e.g., 4.5).
• is_enrolled: A boolean variable set to True representing your enrollment status.
After declaring the variables, print each variable along with its data type using the type() function.
Question 3: Formatted String (f-String) Output
Using the four variables created in Question 2, write a single formatted string (f-string) to output a
summary sentence in the following exact format:
Student Name: John Doe | Matric No: 231622 | GPA: 4.5 | Active Status: True
Question 4: Syntax Error Identification & Correction
Examine the following buggy Python code snippet:
1st_student = "Alex"
course fee = 5000
print(1st_student)
Tasks:
1. Identify the two specific variable naming errors present in the code snippet.
2. Rewrite the snippet using valid Python variable naming rules so that it executes without throwing a
SyntaxError.