Week 1 Assignment (Part 1 - Questions)

05. December 2024

Question 1

What is the result of the following operation 9 // 4?


2.25
1.999999
2
2.0

Question 2

What does the abbreviation "IPO" stand for?


Infinite Programming Opportunities
Intelligent Python Operation
Input Processing Output
International Processing Organization

Question 3

Which function is used to get user input into a program?


userinput()
input()
read_keyboard()
getinput()

Question 4

Which of the following are data types in Python?

Note: There are 3 correct answers to this question.


Time
Name
String
Boolean
Integer

Question 5

Which of the following Boolean expressions is True?

Note: There are 3 correct answers to this question.


(25 > 100) or (25 < 100)
25 == "25"
(25 < 100) and (25 > 100)
not(100 < 99)
17 > 10

Question 6

Which of the following statements about the syntax of the if-else statement are correct?

Note: There are 3 correct answers to this question.


To make the program more readable, you can use indention wherever you like.
Each if-statement requires the else-part. An if without an else leads to an error.
The code block (the one belonging to the if- or else-part) needs to be indented.
There must be at least one conditional statement. No statement behind the if and continuing directly with the else leads to an error.
The evaluation of the condition can have exactly two values: True or False.

Question 7

Which of the following conditions are True?

Note: There are 3 correct answers to this question.


not(not(False)
True or False
True and True
not(False)
True and False

Question 8

Which of the following statements about if-statements are correct?

Note: There are 2 correct answers to this question.


The number of elifs in an if-statement is limited.
There can be either "elifs" or nesting. Both "elif" and nesting in one if-statement is forbidden.
According to the syntax of Python, the amount of nesting is not limited.
Conditions can have more than two outcomes.
Even though many levels of nesting are syntactically correct, too much nesting should be avoided to keep a program readable and maintainable.

Question 9

Which animal is the result of this code?

week1 assignment f9

eagle
bear
horse
chicken

Question 10

If a and b are two Boolean variables and a is True and b is False, which of the following expressions is True?


a and b
not(a) and not(b)
not(a or b)
a or b

< Previous unit | Next unit > | Course Overview