In order to check if your development environment has been set up correctly, first run a "Hello World" script (and by 'script' in this case we mean one single line of code as you can see below).
By the way: save your scripts with an extension ".py". Your editor (in my case Visual Studio Code) will then recognize the language, format it properly, check your syntax, offer autocompletion and many other nice things.
By default, Python treats your code as if it was in a 'main()' procedure. Actually, if you run a script from the command line, Python gives the script the module name '__main__'. Much more about main() you can find at this site. But I prefer to learn by example, so here we go.
The second example illustrates some features of Python. The code in this example determines if a number is prime (that is, a number that is divisible only by itself and 1 (e.g. 2, 3, 5, 7, 11). By the way, the code below is not very efficient and could be improved in many ways.
By looking at this second example, you can learn a few things:
print("Hello, World!")
# Check if f a number is a prime number - the dumb way import math v = 47 # The second argument, end='', prevents the print command to create a new line print(('Is the number {} a prime number ? ').format(v), end ='') # 1 is special with primes if v > 1: # Iterate from 2 to sqr(v), rounded up m = math.ceil(math.sqrt(v)) for i in range(2, m + 1): # If num is divisible by any number between # 2 and sqr(v)), it is not prime if (v % i) == 0: print('no') break else: print('yes') else: print('no')