Python data types classify the category of value stored in a variable, defining what kind of operations can be safely performed on it.
Since Python is a dynamically typed language, you do not need to explicitly declare data types when creating a variable; the interpreter automatically infers the correct type at runtime based on the value assigned.
Sequence Data Types: Sequence data types in Python are built-in containers that store multiple values in a specific, organized order.
Types: String, List, Tuple, Range
String - Immutable (Unchangeable) and Ordered - Sequence of Characters, denoted by str, initialized using double quotation and single quotation.
Code:
string = "this is a string"
print (string)
print (type(string))
List - Mutable (Changeable) and Ordered - Flexible, Dynamic Array holding Mixed Data Types, denoted by list, initialized using square braces.
Code:
myList = ["Ari", "Codes", 5, 0.25]
print (myList)
print (myList[0])
print (type(myList))
print (type(myList[3]))
item assignment
myList[0] = "Codes"
myList[1] = "Ari"
print (myList[0])
print (myList[1])
myList.append(67)
print (myList)
Tuple - Immutable and Ordered - Fixed-Sized Containers for Mixed Data Types used for Data Protection against Accidental Modification, denoted by tuple, initialized using parenthesis.
Code:
myTuple = ("Ari", "Codes", 5, 0.25)
print (myTuple)
print (myTuple[1])
print (type(myTuple))
print (type(myTuple[2]))
but if we try the above two things (item assignment and append) with tuple it will give error as tuple is immutable i.e. Tuple does not support item assignment and Tuple have no append attribute
On this page of the site you can watch the video online Python Basics - Data Types Part 2 | with a duration of hours minute second in good quality, which was uploaded by the user AriCodes 13 July 2026, share the link with friends and acquaintances, this video has already been watched 17 times on youtube and it was liked by 3 viewers. Enjoy your viewing!