
Phython MCQ 12
Authored by Balwan Yadav
Computers
12th Grade
Used 4+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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.
Access all questions and much more by creating a free account
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
Already have an account?
Similar Resources on Wayground
15 questions
1.1.1 The structure and function of the processor
Quiz
•
11th Grade - University
15 questions
Quiz 1
Quiz
•
1st - 12th Grade
10 questions
PUNCTUATION SPACING RULES
Quiz
•
9th - 12th Grade
10 questions
A level Computer Science In-fix post-fix Reverse polish
Quiz
•
10th Grade - University
10 questions
COMPUTER PROGRAMMING Q2_FLOWCHART (2 points each)
Quiz
•
11th - 12th Grade
10 questions
2025 python class first quiz
Quiz
•
9th Grade - University
13 questions
Guess the Retro Computer 1
Quiz
•
KG - Professional Dev...
11 questions
Threats to Data
Quiz
•
9th - 12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade