logo

Crowdly

Browser

Add to Chrome

2025 COMP100P1 Introduction to Computer Science

Looking for 2025 COMP100P1 Introduction to Computer Science test answers and solutions? Browse our comprehensive collection of verified answers for 2025 COMP100P1 Introduction to Computer Science at learn2025.ukzn.ac.za.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

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%
View this question

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%
View this question

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=' ')

View this question

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%
View this question

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=" ")

View this question

When the code below is executed

x = 1

if (x < 1):

print("x")

else:

print("o")

0%
0%
0%
0%
0%
View this question
Which of the following declarations is incorrect in Python language?
0%
0%
0%
0%
0%
View this question
To read in a value from the user for variable x we would use the python statement

View this question

What is the output of the following code:

x = 10

y = float(x)

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

View this question
What is the order of precedence in python?
View this question

Want instant access to all verified answers on learn2025.ukzn.ac.za?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome