Introduction
In this unit, we will make a quick introduction to the basics of Python, with the aim of getting you up and running, ready to start some more stats and probability oriented labs.
Basic facts
Python programs
Thanks to Visual Studio Code, we will write small Python programs, which are plain text files with extension .py.
These files, when executed from Visual Studio Code or from the command line with python myfile.py, are run sequentially from the first line to the last line.
Data structures
Python admits many data structures which allow a powerful and flexible manipulation of objects. We will only see a few basic ones in the following videos.
Basic input and output
Loops
Conditional statements
As in any programming language, the conditional statements are a basic building block of a program. They allow to trigger a series of instructions when a given condition holds.
Challenge 4:
Add to your program a block of code that requests an integer n from the user and checks whether n is a prime number