Lab 4 – 2017

Slides: [ EST ] [ ENG ]

All tasks should be submitted via gitlab. Task1 and Task3 are mandatory. Without completing them, Task2 and Task4 won’t be graded.

Homework (3p):

Task1  (1p)

  • Create variable student of ??? type, which contains following data about the student:
    • Name
    • Age
    • Courses e.g. math, chemistry, english
    • 1..5 grades in each course
  • Ask the user to input that data / randomly generate it
  • Calculate Average grade per course (and display it on screen)


Task2 (0.5p) [optional]

  • Create stores variable of type ??? in which one store has following data:
    • Items for sale
      • Item name
      • Item price
  • Sort items which have price lower than 10 euro and:
  • Display store, item name, item price


Task3 (1p)

  • Create a List
  • Ask 5 strings from user (and append to list)
  • Ask for 1 string, remove that string from the list
  • Ask for 1 string, add it in front of the list
  • Find strings which have more than 1 word
  • Print each word on separate line
  • Ask for a string, store it in a variable
  • Print this string in reverse order (e.g. rofl -> lfor)NB! Print all the strings between steps (to verify changes)!


Task4 (0.5p) optional

Implement your lab2 algorithm in Python


One thought on “Lab 4 – 2017

  1. Pingback: Lab 4 – iax058x

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.