python quiz 3

 


  Start date :- 28/04/2021                                End date :- 11/05/2021


PYTHON QUIZ 3..

____________________________________________________________________________________________________


Q.1. If :-
        A=set('python')
        B=set('programming')
        Then what will be the output of print(A-B) ?

1.
2.
3.
4.
ANSWER :- (3)  As we subtract a from b then all alphabets of a present in b are removed and rest left in a which are not present in b are given as output. 

____________________________________________________________________________________________________  
Q.2. What will be the outcome of the following code?
        count=40
        print(count>=30 and count<39)
1.
2.
3.
4.
ANSWER :-  (2) It will return false as count is 40 but condition provided in print is not true as 40 can not be less then 39.

__________________________________________________________________________________________________  
Q.3. If we have a list as :-
names=['abhay', 'mahesh', 'prashant', 'sandeep'] , then what does the following statement do:
'rakesh' in names
1.
2.
3.
4.
ANSWER :-  (1) As here in function is used which checks truthness of statement given. as here it checks the condition that whether rakesh is present in list of given names.

_______________________________________________________________________________________________  
Q.4. What will be the output of the following code?
        print( (3 < 1) and (4/0 > 1))
1.
2.
3.
4.
ANSWER :- (1) here it will return false as value given in code is not satisfying condition, 3 is not less than 1 and 4/0 is undefined or 0 which can't be greater than 1.

_____________________________________________________________________________________________  
Q5. In Python 'And' and 'Or' operators are also called:
1.
2.
3.
4.
ANSWER :- (3) In Python 'And' and 'Or' operators are also called as short circuit operators and logical operators , if using and here if first condition is true then only second condition will be executed. And in or operator second condition will execute if first condition is false.

________________________________________________________________________________________


👀👀👀 NEXT QUIZ COMMING SOON STAY UPDATED.......👀👀👀

                                                                    only at  : -   hi-tutorial.blogspot.com

___________________________________________________________________________________________




Comments

Post a Comment