0% found this document useful (0 votes)
6 views9 pages

ReactNativeBlobUtilTmp Db71krfin7al5kficrd22c

The document discusses data types in programming, specifically focusing on integers, floats, and strings. It includes examples and tasks for students to practice recognizing and manipulating these data types in Python. The activities encourage critical thinking and hands-on coding experience with mixed data types in a shopping cart scenario.

Uploaded by

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

ReactNativeBlobUtilTmp Db71krfin7al5kficrd22c

The document discusses data types in programming, specifically focusing on integers, floats, and strings. It includes examples and tasks for students to practice recognizing and manipulating these data types in Python. The activities encourage critical thinking and hands-on coding experience with mixed data types in a shopping cart scenario.

Uploaded by

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

7.

1-BLOCK IT OUT:
MOVING FROM BLOCKS TO TEXT
GRADE 6
Topic: Datatypes
CHALLENGING/CRITICAL THINKING

Imagine you are creating a program to calculate the total cost


of items in a shopping cart.
• How would you handle mixed data types
• e.g: item prices as floats
item quantities as integers
item names as strings
ENGAGE What do you
think the value ?

age = 25 number or text


(number)

temperature = 36.5 How did you figure that out


(decimal number) that 36.5 is a decimal
number?

name = “Peter pan”


(string)
Integers are whole numbers like 25
floats are decimal numbers like 36.5
strings are used for words like “Peter pan”
DATATYPES
Defining the type of the value a data can contain.

integer
Whole number consists of + or – sign without decimal point
Example : a=10, b=-10

float
Floating point numbers which contain decimal point
Example : a=10.5,b=10.0

string
Sequence of characters used to store and represent text-based information
Example : name=“rani”, username=‘kamini’
Explore and
Evaluate
Task: write code, recognize these values, and see how Python handles them.

# Example 1: Integer
height = 120
print(height)

# Example 2: Float
temperature = 36.6
print(temperature)

# Example 3: String
name = “Kavin" QUESTION:
print(name) Change the value of height to float value in example 1
Change temperature to a new integer value in example 2
Change name to another string in example 3
AFL

1. Changing the value of height to a float will result in a decimal number.

2. If the value of temperature is changed to an integer, it will be printed with decimal places.

3. Changing the value of name from "Kavin" to "Sophia" will print "Sophia".

ANSWERS:
TRUE,FALSE,TRUE
Activity 1: Activity 2:

Task 1: Assign an integer value to the variable


num1 and a float value to num2.

Task 2: Perform the following operations:


Task 1: Create three variables: • Add num1 and num2 and save it in another
one for an integer variable num3
one for a float • Print the variable num3
one for a string • Subtract num1 from num2 and save it in
num4
Task 2: Print each of these • Print the variable num4.
variables to confirm the values.
Task 3: Assign a string to greeting
print it combined with another string using
concatenation.

You might also like