CARVIEW |
Python Introduction and Variables
Python Introduction and Variables
Question 1
Which of the following keywords is used to define an object constructor in Python?
init
constructor
__init__
define
Question 2
Which of the following keywords is used to declare an alias for a module in Python?
import as
using
alias
import
Question 3
What keyword is used to define an empty function or class in Python?
continue
skip
pass
break
Question 4
What is the correct way to output “Hello, World” in Python?
echo("Hello, World")
printf("Hello, World")
print("Hello, World")
console.log("Hello, World")
Question 5
Which command is used to check if Python is installed on a Windows system using the command prompt?
python -v
python --version
python check
py -install
Question 6
Which of the following is used to output data in Python?
output()
print()
echo()
display()
Question 7
Which function is used to get the type of an object in Python?
type()
object_type()
class()
get_type()
Question 8
What does the "def" keyword in Python do?
It defines a variable
It defines a function
It defines a class
It defines a loop
Question 9
Which of the following is used to import modules in Python?
import
include
require
using
Question 10
- Integer
- String
- Float
- List
There are 15 questions to complete.