KC Knowledge Check

The Knowledge Check is intended to support learning and self-assessment. The questions highlight the key concepts of this unit and help prepare for the final examination.

The Knowledge Check is not graded.


1️⃣ Variables and Data Types

What is a variable in Python?

Explain in your own words why variables are useful.


2️⃣ Basic Data Types

Give one example for each of the following data types:

  • integer
  • float
  • string
  • boolean

3️⃣ Python Code

Write Python code that:

  • creates a variable called name
  • stores your first name
  • prints the variable

Example:

name = "Anna"
print(name)

4️⃣ Data Types

What data type would you use for the following information?

Information Data Type
Age ?
Temperature ?
City Name ?
True / False ?

5️⃣ Strings

Assume:

city = "Marburg"

What is the result of:

city[:3]

and

city[-2:]

Discussion

The solutions will be discussed during the course session.

Updated: