Skip to content

Commit ac6accb

Browse files
committed
closes yasoob#77
1 parent 75702fe commit ac6accb

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

global_&_return.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ to the global scope.
7575
Multiple return values
7676
^^^^^^^^^^^^^^^^^^^^^^^
7777

78-
So what if you want to return two variables from a function instead of one? There are a couple of approaches which new programmers take. The most famous approach is to use `global` keyword. Let's take a look at a useless example:
78+
So what if you want to return two variables from a function instead of one? There are a couple of approaches which new programmers take. The most famous approach is to use ``global`` keyword. Let's take a look at a useless example:
7979

8080
.. code:: python
8181
@@ -94,7 +94,7 @@ So what if you want to return two variables from a function instead of one? Ther
9494
9595
**Note:**Don't try to use the above mentioned method. I repeat, don't try to use the above mentioned method!
9696
97-
Some *return* a `tuple`, `list` or `dict` with the reqired values after the function terminates. It is one way and works like a charm.
97+
Some try to solve this problem by *returning* a ``tuple``, ``list`` or ``dict`` with the reqired values after the function terminates. It is one way to do it and works like a charm:
9898

9999
.. code:: python
100100
@@ -110,7 +110,7 @@ Some *return* a `tuple`, `list` or `dict` with the reqired values after the func
110110
print(profile_data[1])
111111
# Output: 30
112112
113-
What many programmers don't know is that you can return two separate values as well. Let's take a look at an example so that you can better understand it:
113+
But what many programmers don't know is that you can return two separate values as well. Let's take a look at an example so that you can better understand it:
114114

115115
.. code:: python
116116
@@ -126,4 +126,4 @@ What many programmers don't know is that you can return two separate values as w
126126
print(age)
127127
# Output: 30
128128
129-
This is a better way to do it along with returning `tuples`, `lists` and `dicts`. Don't use `global` keyword unless you know what you are doing. `global` might be a better option in a few cases but is not in most of them.
129+
This is a better way to do it along with returning ``tuples``, ``lists`` and ``dicts``. Don't use ``global`` keyword unless you know what you are doing. ``global`` might be a better option in a few cases but is not in most of them.

0 commit comments

Comments
 (0)