Everything is object in Python (Mutable, Immutable…)

  • First, the data type in python are list, dictionary, tuple, string, int, float…all of these are object.
data types
  • How can i know what type are a data and how i can know his id in memory ?
type()
id()
  • Every data type can be really modified without being copied ?
integer
Modifying a string
example mutable list
  • How python treat mutable and immutable object ?
Two immutable string
two mutable object
aliasing two mutable object
  • How python works with variables passed in argument of functions ?
  • Bonus : Range integer -5 to 257

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store