1 / 7

Immutable vs Mutable Data Types in Python

This presentation is here to help you understand about the data types in Python, and it explains about type casting/type conversion, as well as Immutable vs Mutable Data Types in<br>Python

Download Presentation

Immutable vs Mutable Data Types in Python

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Data Types in Python Swipe

  2. Type Casting/Type Conversion in Python Int(x) float(x) complex(x,y) bool() str() int (10) float (10) complex(10) bool(0) srt('python') int(10.20) float (10.20) complex(10.20) bool(0.0) str('10.20') int('10') float ('10') complex('10') book(0+0j) str(complex(10,20)) int('10.20') float ('10.20') complex('10.20') bool('') int(0b1010) float (0b1010) complex(0b1010) bool([]) int(true) float (true) complex(true) bool(0) int(A) float (A) complex(A) bool(none) int(true) float (true) complex(true) bool(* *)

  3. Immutable vs Mutable Data Types in Python By now you may have heard the phrase “everything in Python is an object”. Objects are abstraction for data, and Python has an amazing variety of data structures that you can use to represent data, or combine them to create your own custom data.

  4. Immutable vs Mutable Data Types in Python A first fundamental distinction that Python makes on data is about whether or not the value of an object changes. If the value can change, the object is called mutable, while if the value cannot change, the object is called immutable. ( ) Vs [ ]

  5. Mutable Data Type in Python Note:- Mutable sequences can be changed after creation. Some of Python’s mutable data types are: lists, byte arrays, sets, and dictionaries. List Bytes arrays Mutable Data Types Sets Dictionaries

  6. Immutable Data Type in Python Note:- Immutable can not be changed after creation. Some immutable types include numeric data types, strings, bytes, frozen sets, and tuples. Numeric Data Types Strings and Bytes Immutable Data Types Frozen Sets Tuples

  7. Topics for next Post Mutable vs Immutable Data type in Python Stay Tuned with

More Related