What symbol is used for comments in Python?
#
What is Python?
A type of snake
A high-level programming language
A video game
A high-level programming language.
What is Java primarily known for in the world of computer programming?
Object-oriented programming
Which loop in Java is ideal for situations where you want to execute a block of code a fixed number of times?
For loop
How do you check the length of a string in Python?
len()
How do you print "Hello, World!" in Python?
print("Hello, World!")
Which of the following is not a valid variable name in Python?
my_variable
123_variable
variable123
123_variable
Which data type is used to store whole numbers in Java?
int
str = "Programming is fun"
changed = str[5] + str[len(str) – 1] + str[0]
print(changed)
What is printed after the code above executes?
mnP
How do you define a function in Python?
a) func my_function():
b) define my_function():
c) def my_function():
c) def my_function():
Which is a mutable data type in Python?
list
What is the keyword used to exit a loop prematurely in Python?
break
Which Java keyword is used to create an instance of a class?
new
What is the purpose of the "if" statement in Python?
To control the flow of code based on conditions
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
What is the output of "raw"[::-1]?
war
What symbol is used to indicate a single-line comment in Java?
//
What is the purpose of the 'break' statement in a loop?
To exit the loop immediately
In Java, what is the term for reusing code by inheriting properties and behaviors from a parent class?
Inheritance
What is the result of "Good" + "Morning" in Python?
"Good Morning"
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.
What is the result of 5 + 3.0 in Python?
8.0
Which keyword is used to define a class in Java?
class
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.
Which Python module is used for working with regular expressions?
re