We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent db4b9f8 commit 0659dd7Copy full SHA for 0659dd7
README.md
@@ -4,4 +4,4 @@ Playground to test python concepts and standard functionalities
4
## Python functionalities
5
[enumeration](enumeration.py)
6
[list_comprehension](list_comprehension.py)
7
-
+[named_tuple](named_tuple.py)
named_tuples.py
@@ -0,0 +1,14 @@
1
+"""Named tuples can be used to return values e.g. from a function
2
+in a structured way.
3
+This has the benefit, the data can be accessed by the attribute.
+
+"""
+from collections import namedtuple
8
9
+Geoposition = namedtuple('Geoposition', ['latitude', 'longitude'])
10
11
+position = Geoposition('49.12345', '1.12345')
12
+print(position)
13
+print(position.latitude)
14
0 commit comments