Python Fundamentals
Last updated on 2024-02-23 | - + Edit this page
- - - + + +Objectives
Variables -
+Variables +
Any Python interpreter can be used as a calculator:
-Using Variables in Python -
+Using Variables in Python +
Once we have data stored with variable names, we can make use of it in calculations. We may want to store our country’s raw GDP value as well as the GDP per capita:
@@ -486,8 +486,8 @@PYTHON<
uk_language_code = 'ISO_' + uk_language_code
-Built-in Python functions -
+Built-in Python functions +
To carry out common tasks with data and variables in Python, the
language provides us with several built-in functions. To display information to
the screen, we use the print
function:
PYTHON<
-
+
OUTPUT
@@ -696,7 +696,7 @@ PYTHON<
-
+
OUTPUT
@@ -731,7 +731,7 @@ PYTHON<
-
+
PYTHON
@@ -785,7 +785,7 @@ Key Points
- Next: Reading Tabular Data...
+ Next: Reading Tabular Data...
@@ -796,18 +796,18 @@ Key Points
This lesson is subject to the Code of Conduct
-
+
Edit on GitHub
-
+
| Contributing
| Source
-
+
Materials licensed under CC-BY 4.0 by the authors
-
+
Template licensed under CC-BY 4.0 by The Carpentries
Built with sandpaper (0.16.5), pegboard (0.7.6), and varnish (1.0.3)
@@ -832,7 +832,7 @@ Key Points
OUTPUT
@@ -696,7 +696,7 @@ PYTHON<
-
+
OUTPUT
@@ -731,7 +731,7 @@ PYTHON<
-
+
PYTHON
@@ -785,7 +785,7 @@ Key Points
- Next: Reading Tabular Data...
+ Next: Reading Tabular Data...
@@ -796,18 +796,18 @@ Key Points
This lesson is subject to the Code of Conduct
-
+
Edit on GitHub
-
+
| Contributing
| Source
-
+
Materials licensed under CC-BY 4.0 by the authors
-
+
Template licensed under CC-BY 4.0 by The Carpentries
Built with sandpaper (0.16.5), pegboard (0.7.6), and varnish (1.0.3)
@@ -832,7 +832,7 @@ Key Points
OUTPUT
@@ -731,7 +731,7 @@ PYTHON<
-
+
PYTHON
@@ -785,7 +785,7 @@ Key Points
- Next: Reading Tabular Data...
+ Next: Reading Tabular Data...
@@ -796,18 +796,18 @@ Key Points
This lesson is subject to the Code of Conduct
-
+
Edit on GitHub
-
+
| Contributing
| Source
-
+
Materials licensed under CC-BY 4.0 by the authors
-
+
Template licensed under CC-BY 4.0 by The Carpentries
Built with sandpaper (0.16.5), pegboard (0.7.6), and varnish (1.0.3)
@@ -832,7 +832,7 @@ Key Points
PYTHON
@@ -785,7 +785,7 @@ Key Points
- Next: Reading Tabular Data...
+ Next: Reading Tabular Data...
Key Points
This lesson is subject to the Code of Conduct
-
+
Edit on GitHub
-
+
| Contributing
| Source
-
+
Materials licensed under CC-BY 4.0 by the authors
-
+
Template licensed under CC-BY 4.0 by The Carpentries
Built with sandpaper (0.16.5), pegboard (0.7.6), and varnish (1.0.3)
@@ -832,7 +832,7 @@ Key Points
This lesson is subject to the Code of Conduct
- + Edit on GitHub - + | Contributing | Source
Materials licensed under CC-BY 4.0 by the authors
- +Template licensed under CC-BY 4.0 by The Carpentries
Built with sandpaper (0.16.5), pegboard (0.7.6), and varnish (1.0.3)