Python
Easy
Java
Random
Python
100

What symbol is used for comments in Python?

#

100

What is Python?

A type of snake

A high-level programming language

A video game

A high-level programming language.

100

What is Java primarily known for in the world of computer programming?

Object-oriented programming

100

Which loop in Java is ideal for situations where you want to execute a block of code a fixed number of times?

For loop

100

How do you check the length of a string in Python?

len()

200

How do you print "Hello, World!" in Python?

print("Hello, World!")

200

Which of the following is not a valid variable name in Python?

my_variable

123_variable

variable123

123_variable

200

Which data type is used to store whole numbers in Java?

int

200

str = "Programming is fun"

changed = str[5] + str[len(str) – 1] + str[0]

print(changed)

What is printed after the code above executes?

mnP

200

How do you define a function in Python?

a) func my_function():

b) define my_function():

c) def my_function():

c) def my_function():

300

Which is a mutable data type in Python?

list

300

What is the keyword used to exit a loop prematurely in Python?

break

300

Which Java keyword is used to create an instance of a class?

new

300

What is the purpose of the "if" statement in Python?

To control the flow of code based on conditions

300

Which of the following(s) is an example or examples of a Python data type?

a) int

b) string

c) 3.14

a) int

b) string

400

What is the output of "raw"[::-1]?

war

400

What symbol is used to indicate a single-line comment in Java?

//

400

What is the purpose of the 'break' statement in a loop?

To exit the loop immediately

400

In Java, what is the term for reusing code by inheriting properties and behaviors from a parent class?

Inheritance

400

What is the result of "Good" + "Morning" in Python?

"Good Morning"

500

Which of the following is required for the binary search algorithm to be run?

(A) The list must be sorted first.

(B)  The element must be in the list or the algorithm will not work.


(A) The list must be sorted first.

500

What is the result of 5 + 3.0 in Python?

8.0

500

Which keyword is used to define a class in Java?

class

500

What is the purpose of the 'public static void main(String[] args)' method in a Java program?

It is the entry point of the program.

500

Which Python module is used for working with regular expressions?

re

M
e
n
u