Courseiva

PCEP · topic practice

Data Types, Variables, Basic I/O and Operators practice questions

Practise Certified Entry-Level Python Programmer PCEP Data Types, Variables, Basic I/O and Operators practice questions — original exam-style scenarios with answer choices, explanations, and analysis of common mistakes.

Courseiva uses original exam-style practice questions designed for learning and revision. The goal is to understand the concepts, recognise exam patterns, and improve through explanations — not memorise copied exam dumps.

Reviewed byJohnson Ajibi· MSc IT Security
20 questionsDomain: Data Types, Variables, Basic I/O and Operators

What the exam tests

What to know about Data Types, Variables, Basic I/O and Operators

Data Types, Variables, Basic I/O and Operators questions test whether you can apply the concept in context, not just recognise a definition.

How the topic appears in realistic exam-style scenarios.

Which detail in the question changes the correct answer.

How to eliminate plausible but wrong options.

How to connect the question back to the wider exam objective.

Watch out for

Common Data Types, Variables, Basic I/O and Operators exam traps

  • Answering from memory before reading the full scenario.
  • Missing a constraint such as cost, availability, security, scope or command context.
  • Choosing a broad answer when the question asks for the most specific fix.
  • Ignoring why the wrong options are tempting.

Practice set

Data Types, Variables, Basic I/O and Operators questions

20 questions · select your answer, then reveal the explanation

A developer runs the script and enters 'Alice' and '25'. What does it print?

Exhibit

Refer to the exhibit.

name = input('Enter name: ')
age = input('Enter age: ')
print(name + ' is ' + age + ' years old.')

If the user enters 'Alice' and '25', what is the output?

Given the exhibit, what does the code print?

Exhibit

Refer to the exhibit.

x = 10.5
y = 3
result = x // y
print(result)

What is the output of this code?
Question 3mediummultiple choice
Study the full Python automation breakdown →

A company runs a Python script on a server that monitors network traffic. The script reads a configuration file containing a threshold value as a string, e.g., '0.85'. The script compares this threshold to a calculated load average (float). The developer writes: threshold = config['threshold']; if load > threshold: alert(). The alert never triggers even when load exceeds 0.85. The config file is correctly parsed. What is the most likely cause and solution?

Refer to the exhibit. What is the printed value?

Exhibit

Refer to the exhibit.

```python
x = 5
y = 2
z = x ** y + x % y * 2
print(z)
```

A developer needs to swap the values of two variables a and b without using a temporary variable. Which single line of code correctly performs the swap?

A developer is working on a project that requires handling large numbers. They write:

x = 10000000000 y = 3.0 z = x / y

print(int(z))

The output is 3333333333. However, the developer expected 3333333333 (same). But they suspect that integer division might be better. They try:

x = 10000000000 y = 3 z = x // y

print(z)

Output: 3333333333. Both give same. Now they test with negative numbers:

x = -10 y = 3 z1 = x / y z2 = x // y

print(z1, z2)

The output is -3.3333333333333335 and -4. The developer is confused why z2 is -4 instead of -3. Which of the following explains the behavior?

A developer writes the following code: x = 5; y = 2; print(x // y). What is the output?

A junior developer writes: x = 10; y = 3; print(x % y). What will be printed?

A developer needs to convert a string '25' to an integer and then add 10. Which code correctly performs this?

What is the correct way to read a floating-point number from user input and store it in a variable?

A developer wants to assign the value 3.14 to a variable and later change it to the integer 3. Which of the following is true?

Which of the following is a valid variable name in Python?

A developer writes: print(10 * '5'). What is the output?

What is the result of the expression: print(2 ** 3 ** 2) ?

A beginner writes: x = '10'; y = 20; print(x + y). What happens?

Question 16mediummultiple choice
Study the full Python automation breakdown →

Which operator is used to check if two values are equal in Python?

A developer writes: a = 3; b = 4; c = a + b / 2. What is the value of c?

Which TWO of the following are valid ways to create a variable with the integer value 100?

Which THREE of the following expressions evaluate to True?

Which TWO of the following are valid Python data types?

Free account

Track your progress over time

Create a free account to save your results and see which topics improve across sessions.

Focused Data Types, Variables, Basic I/O and Operators sessions

Start a Data Types, Variables, Basic I/O and Operators only practice session

Every question in these sessions is drawn from the Data Types, Variables, Basic I/O and Operators domain — nothing else.

Related practice questions

Related PCEP topic practice pages

Move into related areas when this topic feels solid.

Frequently asked questions

What does the PCEP exam test about Data Types, Variables, Basic I/O and Operators?
Data Types, Variables, Basic I/O and Operators questions test whether you can apply the concept in context, not just recognise a definition.
How should I use these practice questions?
Select your answer before revealing the explanation. Then read why each option is right or wrong — this active recall approach builds retention far faster than re-reading notes.
Can I practise just Data Types, Variables, Basic I/O and Operators questions in a focused session?
Yes — the session launcher on this page draws every question from the Data Types, Variables, Basic I/O and Operators domain. Use a 10-question session first to gauge your baseline, then move to 20 or 30 once the weak spots are clear.
Where can I practise other PCEP topics?
Use the topic links above to move to related areas, or go back to the PCEP question bank to see all topics.
Are these real exam questions or dumps?
These are original practice questions written to test the same concepts the PCEP exam covers. They are not copied from any real exam or dump site.