Introduction to Python — Session 1
In this session we cover:
- An overview of the course
- Background on programming and Python
- Write our first "Hello World" script
- Variables and data types
- Mathematical operators
- String concatenation
Write your code
Questions
Section A
- Write code that prints ‘Hello world’.
- Print the numbers 1 to 5 on a single line.
- Write a script where ‘Hello’ and ‘World’ are printed on two separate lines.
- Write a script that prints a list of names, tabbed on separate lines, e.g. My List of Names: Alice Bob Charlie
Section B
- Write code that prints the value of 2 + 2.
- Write code that prints the value of 5.7 subtracted from 3.4.
- Write code that prints the value of 8 multiplied by 7.
- Write code that prints the value of 144 divided by 12.
- Write code that prints the value of the remainder of 67 divided by 12.
- Write code that finds the value of 20 from
4 - 2 * 6 / 3 * 5
. Hint: you might need brackets.