logo

Crowdly

Browser

Додати до Chrome

2025 COMP100P1 Introduction to Computer Science

Шукаєте відповіді та рішення тестів для 2025 COMP100P1 Introduction to Computer Science? Перегляньте нашу велику колекцію перевірених відповідей для 2025 COMP100P1 Introduction to Computer Science в learn2025.ukzn.ac.za.

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

What is the output of the following code:

a = 5

b = 13

c = 7

if (a < b):

print (a)

print(c)

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

What is the output of the following code:

a = 13

b = 7

c = 5

if (a < b):

if (b < c):

print ("a")

elif (a < c):

print("b")

else:

print(c)

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

Match each chunk of code with the correct output

#chunk 1

i = 1

while (i < 5):

    print(i,end=' ')

    i = i + 1

#chunk 2

i = 0

while (i <= 5):

    print(i,end=' ')

    i = i + 1

#chunk 3

i = 0

while (i <= 5):

    i = i + 1   

    print(i,end=' ')

#chunk 4

i = 0

while (i < 5):

    i = i + 1

    print(i,end=' ')

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

Consider the following code:

if (a > 2.0):

b = 10.0

elif (a > 1.0):

b = 20.0

elif ( a > -1.0):

b = 30.0

else:

b = 40.0

Assume possible values for a are: 4.5, 3.2, 0.01112, and 1.67. Of these values, the one which causes b to be assigned the value 30.0 is

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

Match the chunk of code to the correct output

#Code chunk1

sum

= 0

while

sum <15:

          sum += 3

          if sum % 2 == 0:

             print("",end="")

          else:

             print(sum, end= " ")

#Code chunk2

sum = 0

while

sum < 15:

          sum += 3

print(sum,end=" ")

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

When the code below is executed

x = 1

if (x < 1):

print("x")

else:

print("o")

0%
0%
0%
0%
0%
Переглянути це питання
Which of the following declarations is incorrect in Python language?
0%
0%
0%
0%
0%
Переглянути це питання
To read in a value from the user for variable x we would use the python statement

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

What is the output of the following code:

x = 10

y = float(x)

print("x is",x,"and y is",y)

Переглянути це питання
What is the order of precedence in python?
Переглянути це питання

Хочете миттєвий доступ до всіх перевірених відповідей на learn2025.ukzn.ac.za?

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

Browser

Додати до Chrome