From 3b4b321533904b98a0cdc56eaec73b3dca73109f Mon Sep 17 00:00:00 2001 From: fredsh Date: Thu, 6 Jun 2019 20:16:02 +0200 Subject: [PATCH] base hello world exampe --- main.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 main.py diff --git a/main.py b/main.py new file mode 100644 index 0000000..7fcc8dc --- /dev/null +++ b/main.py @@ -0,0 +1,23 @@ + +# Function `print` prints the values to a stream, or to sys.stdout by default. +print("Hello, World"); + +worldStr: str = "World"; + +print("Hello, " + worldStr); + + +# By using %s, we can do string formating and inject a variable +# It is cleaner and more readable than using string concatenation +print("Hello, %s" % worldStr); + +# The line below would cause an error +# %i expects a numerical value to be supplied +# print("Hello, %i" % worldStr); + + +# This script can be run simply by typing +# `python3 main.py` in your terminal +# Note that you will need to have python3 installed on your system + +# To enable type annotation check, you need to install `mypy`. \ No newline at end of file