logo

Crowdly

Browser

Додати до Chrome

24-25 CS1821/CS1822/DC1821: Programming Laboratory

Шукаєте відповіді та рішення тестів для 24-25 CS1821/CS1822/DC1821: Programming Laboratory? Перегляньте нашу велику колекцію перевірених відповідей для 24-25 CS1821/CS1822/DC1821: Programming Laboratory в moodle.royalholloway.ac.uk.

Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!

To complete the checkpoint you need to discuss your solution with a

teaching assistant during the checkpoint sessions. Use the box below to

make any notes that will be useful.

Переглянути це питання

To complete the checkpoint you need to discuss your solution with a teaching assistant during the checkpoint sessions. Use the box below to make any notes that will be useful.

Переглянути це питання

Match the following expressions with their values.

Переглянути це питання

Which of the following programs is the shortest that is also equivalent to the following code?

if i % 4 == 0:

x = 0

elif i % 4 == 1:

x = 1

elif i % 4 == 2:

x = 2

else:

x = 3

0%
0%
0%
0%
Переглянути це питання

What values could the expression i % 4 evaluate to?

0%
0%
0%
0%
0%
0%
0%
0%
0%
0%
Переглянути це питання

To complete the checkpoint you need to discuss your solutions with a

teaching assistant during the checkpoint sessions. Use the box below to

record any notes that might be useful.

Переглянути це питання

What is the difference between the two population sizes after 50 years?

Переглянути це питання

The checkpoint sheet is not complete until it has been marked by a TA. During your checkpoint marking meetings, a TA will discuss your work with you and ask some simple questions. If you show a good understanding of the code you have written, they will mark this question (and therefore the sheet) as passed.

You do not need to write anything in the box below, but may use it for notes if you wish.

Переглянути це питання

We can compare the value of two numerical expressions to obtain a boolean value. Comparison operators that you might use include == (checking equality), != (checking for disequality), > (greater than), and < (less than).

What do think the value of the following expressions are?

You can check the answers by extending your program in expressions.py to print out the values of these expressions.

Переглянути це питання

The boolean constants in Python are True and False, and the operators for combining boolean expressions are and, or, and not. If <<expr1>> and <<expr2>> are two boolean expressions, then:

  • the boolean expression <<expr1>> and <<expr2>> evaluates to true exactly when both <<expr1>> and <<expr2>> evaluate to true, and evaluates to false otherwise;
  • the boolean expression <<expr1>> or <<expr2>> evaluates to true when at least one of <<expr1>> and <<expr2>> evaluate to true, and evaluates to false otherwise; and
  • the boolean expression not <<expr1>> evaluates to true exactly when <<expr1>> evaluates to false, and vice-versa.

What do you think the order of precedence is between and, or and not? You can check the answers by extending your program in expressions.py to print out the result of evaluating the following boolean expressions.

    Переглянути це питання

    Хочете миттєвий доступ до всіх перевірених відповідей на moodle.royalholloway.ac.uk?

    Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!

    Browser

    Додати до Chrome