From a9468420065a523dc3d9d44fd4bbebefac82544f Mon Sep 17 00:00:00 2001 From: decorator-factory <42166884+decorator-factory@users.noreply.github.com> Date: Wed, 1 Apr 2020 12:54:13 +0300 Subject: Fix hard-wrapping in mutability.md --- bot/resources/tags/mutability.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/bot/resources/tags/mutability.md b/bot/resources/tags/mutability.md index fc9e5374d..48e5bac74 100644 --- a/bot/resources/tags/mutability.md +++ b/bot/resources/tags/mutability.md @@ -1,7 +1,6 @@ **Mutable vs immutable objects** -Imagine that you want to make all letters in a string upper case. -Conveniently, strings have an `.upper()` method. +Imagine that you want to make all letters in a string upper case. Conveniently, strings have an `.upper()` method. You might think that this would work: ```python @@ -12,17 +11,16 @@ print(string) # abcd `string` didn't change. Why is that so? -That's because strings in Python are _immutable_. You can't change them, you can only pass -around existing strings or create new ones. +That's because strings in Python are _immutable_. You can't change them, you can only pass around existing strings or create new oness. ```python string = "abcd" string = string.upper() ``` -`string.upper()` creates a new string which is like the old one, but with all -the letters turned to upper case. -`int`, `float`, `complex`, `tuple`, `frozenset` are other examples of immutable data types in Python. +`string.upper()` creates a new string which is like the old one, but with allthe letters turned to upper case. + +`int`, `float`, `complex`, `tuple`, `frozenset` are other examples of immutable data types in Python. Mutable data types like `list`, on the other hand, can be changed in-place: ```python -- cgit v1.2.3