0% found this document useful (0 votes)
28 views3 pages

4 - Python-Data-Types

This document discusses Python data types including numbers (integers and floats), booleans, strings, and complex types like dictionaries and objects. Integers can be positive or negative whole numbers, floats can have decimal points, and booleans can have the values of True or False. Strings store text using single or double quotes and support multiline text. Complex types cover later topics like dictionaries and objects.

Uploaded by

Saa Nia
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)
28 views3 pages

4 - Python-Data-Types

This document discusses Python data types including numbers (integers and floats), booleans, strings, and complex types like dictionaries and objects. Integers can be positive or negative whole numbers, floats can have decimal points, and booleans can have the values of True or False. Strings store text using single or double quotes and support multiline text. Complex types cover later topics like dictionaries and objects.

Uploaded by

Saa Nia
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/ 3

Python Data Types

Integer 10 -3
Numbers
Floats 1.8 -6.973

Booleans True False

Strings ‘Hi there!’ "Hi there!”

C o ve
red L
Complex Types like Dictionaries & Objects ater
Numbers

Integer Float

10, -55, 5421 1.591, -0.81, 5000.0

As big (small) as supported by your As big (small) as supported by your


Memory and Operating System Memory and Operating System

Convert other types to Integer with Convert other types to Float with
int() float()

Write long numbers in easily readable way: 1_000_000.0


Strings

Store Text (Multiple Characters)

"""some multiline
'some text' "some text"
text"""
Choose one and stick with it

As big (small) as supported by your Memory and Operating System

Convert other types to String with str()

Access Characters via Index: my_string[1]

Special Methods like replace()

You might also like