0% found this document useful (0 votes)
34 views2 pages

Comp.10 - WEEK 4

This document contains a student's worksheet on identifying and converting data types in Python. It includes 5 questions testing the student's knowledge of different data types in Python like int, float, string, and list. It also contains 5 code examples where the student is asked to supply the result of converting between data types or accessing elements of lists and sets. The worksheet is for a 10th grade computer class and was completed on February 14-19, 2021.
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)
34 views2 pages

Comp.10 - WEEK 4

This document contains a student's worksheet on identifying and converting data types in Python. It includes 5 questions testing the student's knowledge of different data types in Python like int, float, string, and list. It also contains 5 code examples where the student is asked to supply the result of converting between data types or accessing elements of lists and sets. The worksheet is for a 10th grade computer class and was completed on February 14-19, 2021.
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
You are on page 1/ 2

Name: Rian,Kimberly A.

Score: ____________
Year & Section:10-Cherimoya Mrs. Rachelle B. Gagan

COMPUTER 10 - WORKSHEET 4
TOPIC: Identifying and Converting Data Types
COMPLETION DATE: February 14 - 19, 2021 (1 week)

Let’s Test Ourselves


Briefly answer each item. Type your answers on the lines. - 5 points

1. What are the different data types in Python?


Every value in python has a data type. Since everything is an object in python, data types are
actually classes, and variables are instances (object) of these classes. Numbers in python can
either be plain integers, long integers, floating point numbers, or complex numbers.They are
defined as int, float, and complex class. We can use the type() function to know which class a
variable or a value belongs to and the instance() function to check if an object belongs to a
particular class.

Let’s Test Ourselves:


Identify the Part (115) - 5 points
Identify the part being referred to in each sentence. Write your answers on the lines.

1. A floating point number is accurate up to 15 places.


2. List is an ordered sequence of items.
3. Black is a sequence of characters.
4. Set is an unordered collections of unique items defined by values separated by comma inside braces.
5. Conversion of a float to int will Shorten\Trucate the value.

Let’s Try This: Activity 1


Enumerate the Data Types (112- 113) - 10 points
Give what are asked in each number. Write your answers on the lines.

1. Five (5) examples of int data type.


1. Integers data types
2. Standard integers
3. Short integers
4. Longer integers
5. Even longer integers
2. Five (5) examples of float data types.
1. -321
2. 497
3. 19345
4. -976812
5. 0.0004

Let’s Do This: Supply the New Value


Write/ Type the result for each program line. – 20 points
Program Line Result
1. int (5.7) 5
2. float (9) 9.0
3. str (53) “53”
4. #Give x[8] = r
x = ‘Happy Birthday’
print (“x [8] = “, x [8] ) x[8] =
5. #Given Code {9, 3, 6}
W = { 9,9,3,3,6,6,6}
print (W)

Prepared by: Calibrated by: Noted by:

Mrs. Rachelle B. Gagan Anita I. Rodolfa Mr. Jose M. Giron, Jr.


Subject Teacher Chairperson School Principal

You might also like