
Phython MCQ 12
Quiz
•
Computers
•
12th Grade
•
Practice Problem
•
Medium
Balwan Yadav
Used 3+ times
FREE Resource
Enhance your content in a minute
14 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Which of the following is an invalid datatype in Python?
Set
None
Integer
Real
Answer explanation
In Python, 'Real' is not a valid datatype. The valid datatypes include Set, None, and Integer. 'Real' is often used in mathematical contexts but does not exist as a specific datatype in Python.
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Given the following dictionaries
dict_exam={"Exam":"AISSCE", "Year":2023}
dict_result={"Total":500, "Pass_Marks":165}
Which statement will merge the contents of both dictionaries?
dict_exam.update(dict_result)
dict_exam + dict_result
dict_exam.add(dict_result)
dict_exam.merge(dict_result)
Answer explanation
The correct choice is 'dict_exam.update(dict_result)', which merges the contents of both dictionaries into 'dict_exam'. The other options are invalid methods for merging dictionaries in Python.
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Consider the given expression: not True and False or True Which of the following will be correct output if the given expression is evaluated?
True
False
NONE
NULL
Answer explanation
The expression evaluates as follows: not True is False, so it becomes False and False or True. False and False is False, and False or True is True. Therefore, the correct output is True.
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Select the correct output of the code:
a = "Year 2022 at All the best"
a = a.split('2')
b = a[0] + ". " + a[1] + ". " + a[3]
print (b)
Year . 0. at All the best
Year 0. at All the best
Year . 022. at All the best
Year . 0. at all the best
Answer explanation
The code splits the string 'Year 2022 at All the best' by '2', resulting in ['Year ', '0', '22', ' at All the best']. The output concatenates the first, second, and fourth elements, yielding 'Year . 0. at All the best'.
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Which of the following mode in file opening statement results or generates an error if the file does not exist? (a) (b) (c) (d)
a+
r+
w+
None of the above
Answer explanation
The 'r+' mode opens a file for reading and writing, and it requires the file to exist. If the file does not exist, it generates an error. In contrast, 'w+' creates a new file if it doesn't exist, and 'a+' appends to a file.
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Fill in the blank: ______ command is used to remove primary key from a table in SQL.
update
remove
alter
drop
Answer explanation
The correct command to remove a primary key from a table in SQL is 'alter'. The 'alter' command allows you to modify an existing table structure, including dropping constraints like primary keys.
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Which of the following commands will delete the table from MYSQL database?
DELETE TABLE
DROP TABLE
REMOVE TABLE
ALTER TABLE
Answer explanation
The correct command to delete a table in MySQL is 'DROP TABLE'. 'DELETE TABLE' and 'REMOVE TABLE' are not valid SQL commands, while 'ALTER TABLE' is used to modify an existing table, not delete it.
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
15 questions
CIW
Quiz
•
9th - 12th Grade
16 questions
C-Programming Basics
Quiz
•
12th Grade
10 questions
Word basics
Quiz
•
8th - 12th Grade
10 questions
Aspek Legal TIK
Quiz
•
12th Grade
10 questions
Kuis tipedata, flowchart informatima kelas X j4njang SMA
Quiz
•
9th - 12th Grade
14 questions
TRENDS IN ICT
Quiz
•
12th Grade
14 questions
Computing figures
Quiz
•
4th - 12th Grade
10 questions
Working around Adobe Photoshop
Quiz
•
12th Grade
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
9 questions
FOREST Community of Caring
Lesson
•
1st - 5th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
14 questions
General Technology Use Quiz
Quiz
•
8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
19 questions
Thanksgiving Trivia
Quiz
•
6th Grade
