What is the output in python.?
Answers
Answer:
otput will eligible because age is greater than 20 and gender is exactly equal to 'F'
Answer- The above question is from the chapter "Brief Overview of Python".
Python-
Python is a simple programming language.
It has been created by Guido van Rossum and launched in 1991.
Its features make it easy to understand and this language is used a lot in the big companies and industries.
Given question: What will be the output of the following?
age=23
gender='F'
if age>20 and gender == 'F':
print ('Eligible')
else:
print ('Not eligible')
Answer: We have been given a condition that age should be greater than 20 and gender should be 'F' (feminine gender). Then only, the output will be 'Eligible'.
Otherwise, the output yielded will be 'Not eligible'.
Input values say that age is 23 and gender is 'F'.
As 23 > 20 and 'F' == 'F', hence both the conditions are TRUE.
So, the output will be 'Eligible'.