Python_Institute
PCEP-30-02 · Question #249
PCEP-30-02 Question #249: Real Exam Question with Answer & Explanation
Sign in or unlock PCEP-30-02 to reveal the answer and full explanation for question #249. The question stem and answer options stay visible for context.
Question
Consider the following code.
1 start = input('How old were you at the time of joining?')
2 now = input('How old are you today?')
Which of the following statements will print the right output?
Options
- Aprint(
'Congratulations on '
- str(int(now) - int(start))
- ' years of service!')
- Bprint(
'Congratulations on '
- (int(now) - int(start))
- ' years of service!')
- Cprint(
'Congratulations on '
- str(now - start)
- ' years of service!')
- Dprint(
'Congratulations on '
- int(now - start)
- ' years of service!')
Unlock PCEP-30-02 to see the answer
You've previewed enough free PCEP-30-02 questions. Unlock PCEP-30-02 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.