Search Header Logo
Tough PCEP Questions

Tough PCEP Questions

Assessment

Presentation

Computers

12th Grade

Hard

Created by

Dr. Moriarty

FREE Resource

6 Slides • 17 Questions

1

​Tough PCEP Questions

By Dr. Moriarty

2

What is CPython?

It's the default implementation of Python!

This means that unless you change it on purpose, this is the version you'll use. WE use CPython in here, and the PCEP tests on it :)

Be careful not to confuse this with Cython, which is a version of Python that converts your code to the C programming language!

3

Multiple Choice

Which of the following is true about CPython?

1

It must be installed separately from Python

2

It is only used for web programming

3

It is the version of Python most people use by default

4

It is a paid version of Python

4

Multiple Choice

What is CPython?

1

A library that adds C++ features to Python

2

The default implementation of Python

3

A Python module used for data science

4

A special editor for writing Python code

5

Multiple Choice

What does Cython do that CPython does not?

1

Converts Python code into the C programming language

2

Runs Python code faster without changes

3

Provides a built-in IDE for Python

4

Acts as the official test version of Python

6

What is source code?

A program written in a high-level programming language!

When you write code in this class using Python, C++, Javascript, or others, you're creating source code.
Source code is a bit different than a source
file: source files are the actual .py or .cpp files you can see in your folders, while source code is the code itself...

7

Multiple Choice

What is source code?

1

The binary instructions the CPU executes

2

A program written in a high-level programming language

3

A type of computer hardware component

4

A compressed version of program files

8

Multiple Choice

Which of the following is an example of source code?

1

print("Hello, world!") written in Python

2

A .exe file running on Windows

3

The binary machine code stored in RAM

4

A .zip file containing programs

9

Multiple Choice

What is the difference between source code and a source file?

1

They are the same thing, just different words

2

Source code is the code itself, and a source file stores that code

3

A source file is compiled code, while source code is not

4

Source code only exists in Python, but source files exist in all languages

10

Multiple Choice

Which of the following would typically be considered a source file?

2

The Python interpreter (CPython)

3

A running web browser

4

A machine code .exe file

11

Integrated Development Environments (IDEs) like Thonny and Visual Studio put a bunch of coding applications together that used to be separate a long time ago.

In Thonny, the editor is where you type, and the console is at the bottom where the code prints out.

Debuggers are tools that let you go through code step by step and help you find mistakes. You can activate it from the toolbar in Thonny.

What are debuggers, consoles, and editors?

12

Multiple Choice

In Thonny, where do you type your code?

1

Debugger

2

Editor

3

Console

4

Toolbar

13

Multiple Choice

What is the role of the console in an IDE like Thonny?

1

It stores project files

2

It displays the output of the code you run

3

It highlights syntax errors in your code

4

It is where you write and edit code

14

Multiple Choice

Which statement best describes an Integrated Development Environment (IDE)?

1

A single-purpose tool for editing text files

2

A combination of tools like an editor, console, and debugger in one program

3

A separate program that only runs compiled files

4

A type of operating system for coding

15

What version of Python are we on?

We are currently using Python 3

It is NOT backwards compatible with Python 2 or other earlier verions. This means that if you have something written in Python 2, putting Python 3 code into it might break it.

16

Multiple Choice

Which version of Python are we currently using in this class?

1

Python 1

2

Python 2

3

Python 3

4

Python 4

17

Multiple Choice

Which of the following statements is true about Python 3?

1

It is fully backwards compatible with Python 2

2

It is the version most commonly used today

3

It can only run on Windows systems

4

It is used only for web development

18

Multiple Choice

What does “not backwards compatible” mean in the context of Python 3?

1

Python 3 cannot run Python 2 code without changes

2

Python 3 only runs slower than Python 2

3

Python 3 cannot be installed on older computers

4

Python 3 programs are always less stable than Python 2

19

Multiple Choice

What might happen if you try to run Python 3 code inside a Python 2 interpreter?

1

It will always run without errors

2

It may break or produce errors

3

It will automatically convert to Python 2

4

It will delete the source file

20

Compiling vs Interpreting

Compiling is when you translate the ENTIRE code into machine language (0s and 1s a computer can run). This creates an executable you can send to other people. The other user doesn't need a compiler to run it!

People can't see your original code when they just have the executable, so one benefit of compiled languages is that it hides your source code from people wanting to copy it.

Interpreting is when you translate one line at a time. It's a bit slower, but more flexible as it works on just about every system (you don't need a separate executable for different operating systems). To run interpreted code, the system running it needs an interpreter too.

Python is an interpreted language, C++ is a compiled language.

21

Multiple Choice

What happens during compiling?

1

Each line of code is run immediately

2

The entire program is translated into machine code before running

3

The code is checked only for spelling mistakes

4

The program automatically hides all errors

22

Multiple Choice

Which of the following is TRUE about interpreted languages?

1

They run one line at a time using an interpreter

2

They always run faster than compiled languages

3

They do not need an interpreter on the system

4

They automatically produce executable files

23

Multiple Choice

One benefit of compiled languages is:

1

They are easier to edit once compiled

2

The compiled executable hides the original source code

3

They can only run on Python

4

They always run slower than interpreted languages

​Tough PCEP Questions

By Dr. Moriarty

Show answer

Auto Play

Slide 1 / 23

SLIDE