0% found this document useful (0 votes)
2 views1 page

Task 4 - Intro. to Python

The document outlines a Python training assignment for CodeGear Club, focusing on output, variables, and data types. It includes tasks such as printing text, declaring variables of different data types, creating a formatted string, and identifying syntax errors in a code snippet. The assignment aims to enhance participants' understanding of basic Python programming concepts.

Uploaded by

jimoh9645
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)
2 views1 page

Task 4 - Intro. to Python

The document outlines a Python training assignment for CodeGear Club, focusing on output, variables, and data types. It includes tasks such as printing text, declaring variables of different data types, creating a formatted string, and identifying syntax errors in a code snippet. The assignment aims to enhance participants' understanding of basic Python programming concepts.

Uploaded by

jimoh9645
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

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.

You might also like