Phython MCQ 12

Phython MCQ 12

12th Grade

14 Qs

quiz-placeholder

Similar activities

Microcontroller

Microcontroller

11th Grade - University

10 Qs

Input, output and storage de

Input, output and storage de

8th Grade - Professional Development

14 Qs

Operating System

Operating System

12th Grade

17 Qs

ZOOM QUIZ

ZOOM QUIZ

1st - 12th Grade

10 Qs

loop while/do while

loop while/do while

7th - 12th Grade

10 Qs

Chapter 6 Part 2 - 4

Chapter 6 Part 2 - 4

11th - 12th Grade

11 Qs

Roblox! (Royale High

Roblox! (Royale High

2nd - 12th Grade

10 Qs

EMPTECH L4 Q3

EMPTECH L4 Q3

12th Grade

10 Qs

Phython MCQ 12

Phython MCQ 12

Assessment

Quiz

Computers

12th Grade

Practice Problem

Medium

Created by

Balwan Yadav

Used 3+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?