Data types
Introduction to Python
Worksheet 2: Data types
Complete the table below with the correct data types and give an example of the code using
str(), int() or float().
• String holds alphanumeric data (text, numbers and punctuation) as text
• Integer holds whole numbers
• Float holds numbers with a decimal point
Data Example Data Type Code
Age 14 Integer int(age)
Shoe Size 6.5 Float
Price 14.99
Postcode
Height
Quantity in Stock
Telephone
Number