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

Worksheet 3

The document consists of three tasks related to programming. Task 1 requires selecting appropriate variable names, data types, and explanations for student-related data. Task 2 involves completing a Python program for smartphone details, and Task 3 enhances the program with conditional logic to categorize smartphones based on specifications and user budget.

Uploaded by

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

Worksheet 3

The document consists of three tasks related to programming. Task 1 requires selecting appropriate variable names, data types, and explanations for student-related data. Task 2 involves completing a Python program for smartphone details, and Task 3 enhances the program with conditional logic to categorize smartphones based on specifications and user budget.

Uploaded by

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

TASK 1: Choosing Variables and Data Types

Choose an appropriate variable name, data type, and explanation for the following situations. Fill in
the table below:

Variable Name Explanation Datatype

Stores the registration number of a student.

Stores the student's full name.

Stores the total marks obtained by the student.

Stores the percentage score of the student.

Stores whether the student has passed or failed.

Stores the date of birth of the student.

TASK 2: Completing the Python Program

Below is an incomplete Python program that accepts and prints the details of a smartphone. Fill in
the missing parts.

# Accepting details of a smartphone

phone_brand = input("Enter the phone brand: ")

model = input("Enter the model: ")

________ = _______("Enter the screen size (in inches): ")

ram = ______(input("Enter the RAM size (GB): "))

storage = int(input("Enter the storage capacity (GB): "))

price = __________("Enter the price of the phone: "))

is_available = input("Is the phone available (yes/no)? ") ________ "yes"

TASK 3: Adding Conditional Logic (if-else)

Enhance the smartphone program by adding the following conditions:

1. If the RAM is 8GB or more and storage is at least 256GB, categorize it as a "High-End
Smartphone".

2. If the RAM is 4GB or more and storage is at least 128GB, categorize it as a "Mid-Range
Smartphone".

3. Otherwise, categorize it as a "Budget Smartphone".

4. Ask the user for their budget, and print whether the phone is affordable.

You might also like