Lab 2
Lab 2
Python Programming
Basic Exercise
A.C. 2023-2024
A. Objectives:
1. Understand the fundamental concepts of programming using Python
2. Identify the steps in writing a Python program.
3. Create a simple program that reads input from the user in Python.
4. Create a simple program that displays an output in Python.
B. Materials Required:
1. Computer, Internet, Python IDE (https://replit.com/languages/python3)
C. Discussion:
The print() function allows the program to display text onto the console.
Example:
print(‘This sentence is output to the screen’) This sentence is output to the screen
a=5
*The input value by default has a String data type. int() function explicitly convert the data type
to an integer, and the float() function returns a floating point number.
Task 1
Write a python program that will read the user’s last name and assign its value to the variable lname.
1- Use f-string to display the output “Welcome to ICT 1011 Mr./Ms. <insert lname>”.