Table of Contents

Computer Lab 02, variables, conditionals

admin

please check your official faculty email, see http://www.fel.cvut.cz/en/user-info/ for more details. Making the official e-mail address working and reading it regularly is vital. This is the information channel for important messages from the Faculty and also from the course teachers.

practical work

We will practice exercises from Wentworth2012.

input function helps in reading user input. Certain values are naturally positive (greater than zero). Your program should check this and return something like Error: waiting hours must be greater than zero in case the user inserts a negative number.

homework

weekly homework 02

  • Create a PyCharm project.
  • Create a 02_weekly_hw.py file (module) inside the project you have just created.
  • Create a variable containing a total number of marks from an exam: 2+3+7+9+0+17+22+8.
  • Write a code which automatically assigns a grade (string) to the mark (integer) according to the table below.
  • The square and round brackets denote closed and open intervals. A closed interval [] includes the number, and open interval () excludes it.
  • Output of your submission should contain only one line with a corresponding grade.
  • Upload the 02_weekly_hw.py file to BRUTE.
Mark Grade
>= 75 First
[70-75) Upper Second
[60-70) Second
[50-60) Third
[45-50) F1 Supp
[40-45) F2
< 40 F3