Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
+ 1

# immutable & tuples

please explain those topic with programming which is written above

25th Feb 2018, 2:46 PM
subham gupta
4 Antworten
+ 11
To expand on the really good technical answers already posted here, I thought I'd share a way to make this word make more sense, based on what you already know about other words. One way to remember the meaning of "immutable" is to first associate the word "mutable" with the word "mutate". Think X-Men "mutants", Teenage "Mutant" Ninja Turtles, or how you might have called your sibling a "mutant freak" when arguing as kids. 😂 These all apply to being different or having changed from some other form. Now, if you know that "mutate" means "to change", then "mutable" means "can be changed" or "is changeable". Next, it helps to know that the latin prefix "im" negates the root word that follows to carry an opposite meaning. Examples of words with the "im" prefix: - impossible means not possible - impatient means not patient - imperfect means not perfect - impolite means not polite This pattern can be applied to many other words, such as, immoral, imbalance, impotent, and so on and so forth. Therefore, "immutable" means "not mutable", or rather, as established earlier, "not changeable". Hopefully, with this rather boring pseudo-etymology lesson, the word "immutable" will now sound less strange and more familiar.
25th Feb 2018, 5:55 PM
David Carroll
+ 5
An immutable object is one that cannot be changed once it is created. A tuple is a list(in a way) that you cannot alter once created, that is you cannot add elements to it and you cannot change the value of existing elements. Example: tuple_a = (1, 2, 4) tuple[0] = 9#This is not allowed!
25th Feb 2018, 4:50 PM
David Akhihiero
+ 4