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