0%

Which of the following is the correct syntax for defining a function in Python?

Correct! Wrong!

In Python, the keyword def is used to define a function. The correct syntax is def myFunction(): followed by the function’s code inside the indentation block.

What is the primary purpose of the 'var' keyword in JavaScript?

Correct! Wrong!

In JavaScript, var is used to declare variables with function scope. This means that variables declared with var are accessible throughout the function in which they are defined.

Which data type is used for storing text in Java?

Correct! Wrong!

In Java, the data type used to store text (a sequence of characters) is String. Char is used to store a single character, while String can store multiple characters.

What does the ++ operator do in C++?

Correct! Wrong!

The ++ operator in C++ is known as the increment operator. It increases the value of a variable by 1. It can be used as a prefix (++var) or postfix (var++).

Which of the following is true about the Python keyword 'self'?

Correct! Wrong!

In Python, self is a reference to the instance of the class. It is used within class methods to access instance variables and methods. It is not a keyword but a naming convention.