Infytq Python Questions and Answers 2023 | Set-1

Infytq Python Questions and Answers 2023: In this article, we will be discussing some important Infytq Python Questions and Answers which will help you guys to crack Infytq 2023 exam.

So, If you are also preparing for Infytq exam, Must prepare these questions.

Also check Infytq Detailed Exam Pattern, Click here

Infytq Python questions and answers
Question 1: Find Output

def avg(x, y, z=50):
adding = x+y+z
avg_value = adding // 3
return avg_value
print(avg(x=5, y=9, z=20))

A. 11.33333
B. 13.33333
C. 11
D. 13
Answer: C

Question 2:

Choose the Incorrect answer from the below options
a. view_details method has complete access to all attributes of class trainee
b. id of the trainee object can be changed outside the class trainee even if there is no setter for it.
c. salary of the trainee object can be displayed outside the class trainee using trainee.__salary
d. name of the trainee object can be displayed outside the class trainee without calling the view_details method

Answer: C

Question 3: What will be the output of this code?

y = “this is a random sentence”
print(y_?_)

Output: THIS IS A RANDOM SENTENCE

A. .capitalize()
B. .upcase()
C. .swapcase()
D. .upper()

Answer: D

Question 4: What will be the output of this code?

a. violet
b. Pink
c. Yellow
d. Attribute Error:

Answer: B

Question 5: Find Output

def display_result(winner, score, **other_info):
print(“The winner was “ + winner)
print(“The score was ” + score)
display_result(winner = “ManchesterTeam”, score = “3-1”, overtime = “no”, injuries = “none”)

A. SyntaxError
B. The winner was ManchesterTeam
     The score was 3-1
C. The winner was ManchesterTeam
     The score was 3-1
     [None, None]
D. None of the above
Answer: B

Leave a Reply

Your email address will not be published. Required fields are marked *