Search for:
Search Button
Skip to content
Home
About Us
Course
Master Program in Data Analytics Course
Master Program in Data Science Course
Master Program Business Analytics Course
3‑Month Machine Learning Course
Explore Our Courses
Gallery & Achievements
Blog
Data Analytics
artificial intelligence
Career & Salary
Data Dashboards – Uttarakhand Insights
Information Technology
Power BI
python
SQL
Projects
Contact Us
Search for:
Search Button
Python test
Welcome to your Python test
What is a correct syntax to output "Hello World" in Python?
echo("Hello World");
print("Hello World")
p("Hello World")
echo "Hello World"
None
How do you create a variable with the floating number 2.8?
x = float(2.8)
x = 2.8
Both the other answers are correct
None
What is the correct file extension for Python files?
.py
.pyt
pt
pyth
None
How do you create a variable with the numeric value 5?
x = 5
x = int(5)
Both the other answers are incorrect
Both the other answers are correct
None
Which one is NOT a legal variable name?
my-var
my_var
_myvar
Myvar
None
How do you insert COMMENTS in Python code?
#This is a comment
/*This is a comment*/
//This is a comment
None
What is a correct syntax to return the first character in a string?
x = "Hello"[0]
x = "Hello".sub(0, 1)
x = sub("Hello", 0, 1)
None
In Python, 'Hello', is the same as "Hello"
True
False
None
What is the correct way to create a function in Python?
def myFunction():
create myFunction():
function myfunction():
None
Which method can be used to remove any whitespace from both the beginning and the end of a string?
strip()
ptrim()
trim()
len()
None
Which method can be used to return a string in upper case letters?
upper()
uppercase()
toUpperCase()
upperCase()
None
Which method can be used to replace parts of a string?
repl()
replace()
replaceString(
switch(
None
Which operator is used to multiply numbers?
*
x
#
%
None
Which operator can be used to compare two values?
==
=
><
None
Which of these collections defines a LIST?
["apple", "banana", "cherry"]
{"apple", "banana", "cherry"}
{"name": "apple", "color": "green"}
("apple", "banana", "cherry")
None
Which of these collections defines a TUPLE?
("apple", "banana", "cherry")
{"name": "apple", "color": "green"}
["apple", "banana", "cherry"]
{"apple", "banana", "cherry"}
None
Which of these collections defines a SET?
{"name": "apple", "color": "green"}
{"apple", "banana", "cherry"}
("apple", "banana", "cherry")
["apple", "banana", "cherry"]
None
Which of these collections defines a DICTIONARY?
{"name": "apple", "color": "green"}
("apple", "banana", "cherry")
["apple", "banana", "cherry"]
{"apple", "banana", "cherry"}
None
Which collection is ordered, changeable, and allows duplicate members?
SET
LIST
DICTIONARY
TUPLE
None
What will be the value of the following Python expression? 4 + 3 % 5
0
7
2
4
1
None
Which of the following is used to define a block of code in Python language?
Indentation
Key
Brackets
None
Which of the following character is used to give single-line comments in Python?
//
#
!
/*
None
What will be the output of the following Python code?
i
=
1
while
True
:
if
i%
3
==
0
:
break
print
(
i
)
i +
=
1
1 2 3
error
1 2
none of the mentioned
None
None
None
Time's up
Vista Academy
– 316/336, Park Rd, Laxman Chowk, Dehradun – 248001
📞
+91 94117 78145
| 📧
thevistaacademy@gmail.com
| 💬
WhatsApp
💬 Chat on WhatsApp: Ask About Our Courses