Infosys Certified Python Associate
Practice with real exam-pattern questions for Infosys Certified Python Associate. Each question includes a detailed explanation to help you understand the concept, not just memorise the answer. Try 10 questions free — no login required.
Full question bank for this exam + 1,357+ others. Cancel anytime.
Join Premium10 Infosys Certified Python Associate practice questions with answers
Real Lex exam-pattern multiple-choice questions for the Infosys Certified Python Associate certification. Each question includes the correct answer. The full question bank is available to Premium members.
- Question 1
You are asked to match a pattern exactly at the beginning. Which of these functions would you choose?
- ✓
re.search
Correct - B
re.first
- C
re.match
- D
re.compile
- ✓
- Question 2
Choose the right category according to the classifications made
Jython, IronPython, Pydev, Django
- ✓
Jython, IronPython, Django - Python Frameworks
Correct - B
Pydev, Django - Just Python IDEs and not frameworks
- C
Jython, IronPython are flavours of Python
- D
Pydev, Jython, IronPython are flavours of Python
- ✓
- Question 3
There is some change made to the code present in function 'add' of Calculator Module. This change is done after the module is imported. In the same session, to reflect the changes made, what is the code that needs to be executed?
- ✓
import Calculator
Correct - B
reload(Calculator)
- C
from Calculator import add
- D
import add.Calculator
- ✓
- Question 4
You are asked to replace a pattern with a different pattern. Which of these ways of parameter passing is correct?
- ✓
re.search(extraction pattern, substitution, source string, max substitution)
Correct - B
re.findall( substitution,extraction pattern, source string, max substitution)
- C
re.sub(extraction pattern, substitution, source string, max substitution)
- D
re.sub(substitution, extraction pattern,source string, max substitution)
- ✓
- Question 5
What will be the output of print statement?
var ='Python' print(var + 'entered')
- ✓
Pythonentered
Correct - B
Python + entered
- C
TypeError: cannot perform concatenation on objects
- D
'Python'entered
- ✓
- Question 6
From the below python code, which all numbers can be printed?
for i in range(2,10,2): print(i)for i in range(6,2,-1): print(i)- ✓
2 4 6 8 6 5 4 3
Correct - B
2 4 6 8 10 6 5 4 3 2
- C
2 4 6 8 6 5 4 3 2 1 0 -1
- D
Error: No. of arguments for range function should be 2
- ✓
- Question 7
Which of the following statements are true regarding the opening modes of a file?
- ✓
When you open a file for reading, if the file does not exist, an error occurs
Correct - B
When you open a file for writing, if the file does not exist, an error occurs
- C
When you open a file for reading, if the file does not exist, the program will open an empty file
- D
When you open a file for writing, if the file does not exist, a new file is created
- E
When you open a file for writing, if the file exists, the existing file is overwritten with the new file
- ✓
- Question 8
Identify the FALSE statement made regarding Python Exceptions
- ✓
Finally clause will always be executed irrespective of exceptions being raised or not
Correct - B
else clause will always be executed irrespective of exceptions being raised or not
- C
There can be multiple except blocks for a single try block
- D
Default except block always come at last
ExplanationThe FALSE statement regarding Python Exceptions is:
Option 2: else clause will always be executed irrespective of exceptions being raised or not.
The
elseclause is executed only when no exceptions are raised in thetryblock.The other options are valid:
Option 1: Finally clause will always be executed irrespective of exceptions being raised or not. Option 3: There can be multiple except blocks for a single try block. Option 4: Default except block always comes at last.
Therefore, the correct option is: Option 2 else clause will always be executed irrespective of exceptions being raised or not.
- ✓
- Question 9
Which of the following is a correct way to declare a for loop in python?
- ✓
for i in range(1,5):
Correct - B
for i in range 1,2,3,4,5:
- C
for i in range(5,1-1):
- D
for i in range(1,5,1):
ExplanationThe correct way to declare a for loop in Python is the Option 4:
scssfor i in range(1, 5, 1):This creates a loop that starts at 1 and ends before 5, with a step of 1.
Therefore, the correct option is: Option 4 for i in range(1,5,1)
- ✓
- Question 10
How do you identify a package uniquely in Python?
- ✓
Only if 'n' no. of modules are installed in it
Correct - B
Only if it ends with .pac
- C
If it has a __init__.py written inside the folder/directory
- D
If it has modules ending with .pyc
- ✓
More in Code
Infosys Certified Data Consulting Basics
Infosys Certified Pega Senior System Architect
Infosys Certified Open Chain Practitioner
Pay once. Clear every cert this year.
One subscription, full Telegram channel access, every PDF posted during your membership.
- Full access to all 1,357+ certifications
- Monthly updated question banks
- Telegram private channel access
- Cancel anytime
- Everything in Monthly
- Save ₹2,100 vs monthly billing
- Priority answer key requests
- Best for increasing DQ score fast
- Everything in Quarterly
- Lifetime channel access — no renewals
- All future certifications included
- Priority response from admin team
Common questions, straight answers.
A monthly-updated Telegram channel where we post real exam-pattern question banks and detailed answer keys for 1,357+ Infosys Lex certifications. You join once, you get every PDF posted during your membership.
Right after payment on our Graphy page, you'll receive a private invite link to the Telegram channel. Access is instant — usually under 30 seconds.
We compile question banks from the actual Lex test pattern, sourced and verified by 180K+ community members who've recently cleared these exams. Match rate is consistently 85–95%.
Every single month. When Infosys rolls out new versions of certifications, we post updated dumps within 7–10 days. You'll see channel activity weekly.
Clearing certifications is one of the highest-weighted DQ factors. Members typically clear 3–5 certifications in their first 3 months, which moves DQ scores up by a full band.