Download the notebook here
Exercise 1#
In this notebook you do your first steps in Python
Task 1: Hello World#
define a function called hello that takes no arguments and prints Hello World! if it is called.
[ ]:
Task 2: Strings#
[ ]:
a = "I like programming"
Split the variable a into three words and assign these words to the variables a1, a2 and a3.
[ ]:
Task 3: Dictionaries#
define a dictionaries that maps names to a level of Python knowledge. As names you can take your name and the names of a few friends. The Python knowledge should be rated on a scale from 0 to 10.
[ ]:
Now loop over the keys and values of this dictionary and print a nicely formatted message. For example for me, the message that should be printed is:
'Janos has a python level of 8.'
[ ]:
Task 4: Lists#
Write a loop that takes that adds the next eight Fibonacci numbers to the list [1, 1]
[ ]:
[ ]: