Programmer for Noobs
PYTHON Quiz 3 Answers
Q1. If A=set(‘python’) and B=set(‘programming’) What is the output of A-B?
(a): {‘m’, ‘r’, ‘i’}
(b): {‘m’, ‘r’, ‘g’, ‘a’, ‘i’}
(c): {‘h’, ‘y’, ‘t’}
(d): {‘y’, ‘h’, ‘t’, ‘a’}
Reason: A = set and B = set so the output of A-B is {‘h’, ‘y’, ‘t’}.
Programmer for Noobs
Programmer for Noobs
Q2. What should be the outcome of the following? count=40 count>=30 and count<39
(a): True
(b): False
(c): Error
(d): None of above
Reason: count=40 count>=30 and count<39 is False be the outcome of this following .
Programmer for Noobs
Programmer for Noobs
Q3 If names=[‘abhay’, ‘mahesh’, ‘prashant’, ‘sandeep’] , what does the following statement do: ‘rakesh’ in names
(a): checks if ‘rakesh’ is there in names
(b): deletes ‘rakesh’ from names
(c): add ‘rakesh’ to names
(d): append names with ‘rakesh’
Reason: if names the following statement do "rakesh’ in names of checks if ‘rakesh’ is there in names to print do statement .
Programmer for Noobs
Q4. What will be the output of the following? (3 < 1) and (4/0 > 1)
(a): False
(b): True
(c): Run-time error
(d): None of the above
Reason: the output of the following? (3 < 1) and (4/0 > 1) is false .
Programmer for Noobs
Programmer for Noobs
Q5. In Python ‘And’ and ‘Or’ operators are also called:
(a): Short circuit operators
(b): Logical operators
(c): Both A and B
(d): None of the above
Reason: In Python ‘And’ and ‘Or’ operators are also called Short circuit operators & Logical operators .
Programmer for Noobs
Please subscribe to our channel
0 Comments