Homework

Try out these exercises at home. These are just examples. Try to find some more examples in the internet or just play around!

  1. Try to start up Python in Google Collab and see if this gives you correct results:
    1+1
    2
    
  2. How about other operations? Do you remember what * and / are doing? What about % and **? If you don't remember try figuring it out from the Python console. Try, e.g. 1%4, 2%4, 3%4, 4%4, 5%4... or 2**1, 2**2, 2**3, 2**4, 2**5... Can you explain the patterns?
  3. In Python you can add also strings of characters. E.g. 'A' + 'B' would produce 'AB'. What's wrong with the result of the following?
    'Hello' + 'World!'
    
  4. Try adding a number to a string. What happens? What is Python trying to tell you? What if you try to add a string to a number?
  5. How about multiplying a string by a number? Can this work? 'Ha' * 10

You can find our tutorial on how to use the Google Colab and how to use it to submit the homeworks here: Google Colab Tutorial.