Search Header Logo

Principles of Programming Set 2

Authored by DUC Class

Computers

University

Used 1+ times

Principles of Programming Set 2
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

40 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the try...except block?

Import modules
Handle input
Manage exceptions
Define variables
Control indentation

Answer explanation

It prevents the program from crashing on errors.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which tool is used for structured technical writing?

PlantUML
Overleaf
VS Code
Postman
Swagger

Answer explanation

Overleaf is used for LaTeX documents.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of print(bool(1 and 0))?

True
False
Error
1

Answer explanation

1 and 0 results in 0, which is False.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to define a static method?

@method
staticmethod
@classmethod
@staticmethod
methoddef

Answer explanation

Decorator @staticmethod is used for static methods.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does JIT stand for in compiler design?

Jumping Intermediate Translation
Just In Time Compilation
Java Interpreter Technique
Jumbled Instruction Table
Java Implementation Tool

Answer explanation

JIT compiles hot code during execution to optimize performance.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

AOT compilation occurs at which point in the software lifecycle?

During runtime
Before execution
While debugging
After garbage collection
During interpretation

Answer explanation

AOT compiles code into machine instructions before running.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does __doc__ store?

Module name
Script status
Docstring content
Import paths
Variable values

Answer explanation

It holds the module’s documentation string.

Access all questions and much more by creating a free account

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

Already have an account?