Courseiva

FC0-U71 Applications and Software Practice Question

A developer writes a Python script that processes user input. During execution, the script prompts for an age and stores it in a variable. Which data type is most appropriate for the variable that stores the age?

⚠ Common exam trap

The trap here is that input() returns a string, so candidates may pick String, forgetting that the question asks for the most appropriate data type for storing an age, which is numeric.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Integer

An age is a whole number of years, so the Integer type is the natural fit. Python's int type stores whole numbers without a fractional component and supports arithmetic operations directly. Using Integer avoids unnecessary type conversions and preserves numeric semantics for comparisons and calculations.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Float

    Why it's wrong here

    A float stores fractional numbers, but age is normally a whole number of years, so an integer is appropriate. Floats suit measurements like weight or temperature where decimals matter. Storing age as a float introduces unnecessary precision and potential rounding artefacts without benefit.

  • ✗

    Boolean

    Why it's wrong here

    A Boolean holds only True or False, so it cannot represent an age value such as 25 or 40. Booleans suit flags and yes/no conditions, which is why they appear plausible for input handling. The stem needs a numeric type capable of storing arbitrary integer ages.

  • ✗

    String

    Why it's wrong here

    Storing the age as a string keeps the digits as text, so arithmetic comparisons and calculations fail without conversion. Strings suit identifiers, names or codes where no numeric operations occur, making them tempting for raw input. The stem requires a numeric type for processing age values.

  • ✓

    Integer

    Why this is correct

    An integer stores whole-number values without fractional components, matching an age expressed in completed years. It satisfies the stem's constraint that the script processes numeric input into an appropriate variable type, avoiding the precision and comparison issues that arise when ages are held as strings or floating-point values.

About these practice questions

Courseiva writes every FC0-U71 question from scratch — 988 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official CompTIA exam blueprint

This FC0-U71 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the FC0-U71 exam.