Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

ITCC104: Long Quiz 1

Total questions: 50

Worksheet time: 30mins

Name
Class
Date
1.

What is the file extension used for Python scripts?



(a)  

2.

What do you call the set of rules that defines the structure of statements in a programming language?



(a)  

3.

In Python, which character is used for single-line comments?



(a)  

4.

What type of data is stored in variables such as int in C++ and float in Python?



(a)  

5.

Which data type used to store a sequence of characters in Python?



(a)  

6.

  It refers to a visual representation of an algorithm using symbols.



(a)  

7.

What symbol is used to represent a decision-making process?



(a)  

8.

It is a collection of raw facts that can be processed to generate meaningful information.



(a)  

9.

What is a structured way of organizing and managing data to enable efficient access and modification?



(a)  

10.

What is a high-level representation of an algorithm that uses simple, structured language instead of actual code?



(a)  

11.

TRUE OR FALSE:

(5 == 5) and (3 < 5)

(a)  

12.

TRUE OR FALSE:

(10 != 10) or (3 == 5)

(a)  

13.

TRUE OR FALSE:

(5 > 3) and (2 < 5)

(a)  

14.

TRUE OR FALSE:

(8 >= 5) or (2 <= 1)

(a)  

15.

TRUE OR FALSE:

(7 < 3) or (3 <= 5)

(a)  

16.

TRUE OR FALSE:

(5 == 5) and (4 >= 6)

(a)  

17.

TRUE OR FALSE:

(3 != 3) or (6 > 5)

(a)  

18.

TRUE OR FALSE:

not (5 == 5)

(a)  

19.

TRUE OR FALSE:

(2 > 5) and (5 <= 5)

(a)  

20.

TRUE OR FALSE:

(4 >= 6) and (5 < 10)

(a)  

21.

The numeric data type used to store decimal numbers in Python is called (a)   .

22.

  In Python, an (a)   is a set of step-by-step instructions designed to solve a problem.

23.

  The (a)   function is used to get input from the user in Python.

24.

A (a)   is an ordered, changeable collection in Python.

25.

  A (a)   is ordered but immutable.

26.

The (a)   operator is used for exponentiation in Python.

27.

What symbol to use for an input and output process?

(a)  

28.

All data types in Python are _____. Everything is an _____ in Python.

(a)  

29.

These operations involve logical operations on (a)   values.

30.

(a)   operators test if a value is present in a sequence.

31.

What Python statement stores the integer value 50 into a variable named num?

a)

num = 50

b)

50 = num

c)

num == 50

d)

num : 50

32.

Which Python statement creates a list named fruits containing "apple", "banana", and "mango"?

a)

fruits = ["apple", "banana", "mango"]

b)

fruits = ("apple", "banana", "mango")

c)

fruits = {"apple", "banana", "mango"}

d)

fruits = apple, banana, mango

33.

Which Python statement prints "Hello, Python!" to the console?

a)

print("Hello, Python!")

b)

echo("Hello, Python!")

c)

console.log("Hello, Python!")

d)

output("Hello, Python!")

34.

What Python statement finds the remainder when 17 is divided by 4 using the modulus operator?

a)

17 % 4

b)

17 // 4

c)

17 / 4

d)

17 * 4

35.

Given the dictionary person = {"name": "Alice", "age": 25}, which Python statement changes Alice’s age to 30?

a)

person["age"] = 30

b)

person.age = 30

c)

person["name"] = "Alice", "age" = 30

d)

person["age"] == 30

36.

Which Python statement prints numbers from 1 to 5 using a for loop?

a)

for i in range(1, 6): print(i)

b)

for i in range(0, 5): print(i)

c)

for i in range(1, 5): print(i)

d)

for i in range(5): print(i)

37.

What Python statement checks if the value of x is greater than 10 and prints "Greater" if true, otherwise prints "Smaller"?

a)

if x > 10: print("Greater") else: print("Smaller")

b)

if x > 10: print("Smaller") else: print("Greater")

c)

if x > 10: print("Greater") else print("Smaller")

d)

if x > 10 print("Greater") else print("Smaller")

38.

Which Python statement defines a tuple named colors containing "red", "blue", and "green"?

a)

colors = ("red", "blue", "green")

b)

colors = ["red", "blue", "green"]

c)

colors = {"red", "blue", "green"}

d)

colors = ("red", "blue", "green")[]

39.

Which is the correct Python syntax for an if-else statement?

a)

if condition: statement else: statement

b)

if condition: statement elseif condition: statement else: statement

c)

if condition then statement else statement

d)

if condition; else statement")

40.

Write a Python statement to print the type of the variable num.

a)

print(type(num))

b)

type(num)

c)

print(type of num)

d)

type(num).print()

41.

Write a Python statement to find the length of a list called fruits.

a)

len(fruits)

b)

length(fruits)

c)

count(fruits)

d)

Dfruits.len()

42.

Create a Python dictionary named car with keys "brand", "model", and "year" and assign appropriate values to them.

a)

car = {"brand": "Toyota", "model": "Camry", "year": 2021}

b)

car = ("brand": "Toyota", "model": "Camry", "year": 2021)

c)

car = ["brand": "Toyota", "model": "Camry", "year": 2021]

d)

car = {brand: "Toyota", model: "Camry", year: 2021}

43.

What Python statement would you use to check if a number is even?

a)

if num % 2 == 0: print("Even")

b)

if num / 2 == 0: print("Even")

c)

if num % 2 != 0: print("Odd")

d)

if num // 2 == 0: print("Even")

44.

What is the output of the following code: print(5 // 2)?

a)

2.5

b)

2

c)

3

d)

5

45.

Write a Python statement that checks if a variable x is both greater than 5 and less than 10.

a)

if x > 5 and x < 10: print("Between 5 and 10")

b)

if 5 < x < 10: print("Between 5 and 10")

c)

if x > 5 or x < 10: print("Between 5 and 10")

d)

if x > 10 and x < 5: print("Between 5 and 10")

46.

What is the symbol for "Modulus (remainder of division)"?

(a)  

47.

What is the symbol for "Not equal to"?

(a)  

48.

What is the symbol for "Equal to"?

(a)  

49.

What is the symbol for "Exponentiation (power)"?

(a)  

50.

What is the symbol for "not Less than or equal to"?

(a)