PYTHON QUIZ ANSWER WEEK 3 PRUTOR 😉😉

                  WELCOME GUYS TO MY BLOG     

Q:1. If :-

        A=set('python')

        B=set('programming')

        Then what will be the output of print(A-B) ?

        Note :- The Order of output may change.

ANSWER    3.   {'h', 'y', 't'}

REASON 
REASON WE HAVE ONLY REST IN SUBTRACTION IS H,Y,T BECAUSE WHEN WE SUB THAT IT WILL GONE BE SUB PYTHON AND ONLY REMOVE THAT ELEMENTS THAT IS COMMON IN SET B BUT WE WILL NOT CONSIDER THE REST ELEMENTS OF SET B.

Q:2. What will be the outcome of the following code?

        count=40

        print(count>=30 and count<39)

ANSWER   2.    FALSE

REASON 
IT WILL GONE BE FALSE BEACAUSE WHEN WE APPLY COUNT IT WILL COUNT 30 TO 39 ONLY BUT OUR AIM IS 40.

Q:3. If we have a list as :-

names=['abhay', 'mahesh', 'prashant', 'sandeep'] , then what does the following statement do:

'rakesh' in names

ANSWER  1.checks if ‘rakesh’ is there in names

REASON  
WHEN WE APPLY STATEMENT 'RAKESH' IN NAMES IT WILL GONE CHECK IN SET OF NAME.

Q:4. What will be the output of the following code?

        print( (3 < 1) and (4/0 > 1))

ANSWER 1, FALSE

REASON
As the condition is not satisfied 


Q:5. In Python 'And' and 'Or' operators are also called:

ANSWER   2.Logical operators

REASON 
WE CALL "AND" AND "OR" OPERATORS AS LOGICAL OPERATORS. BECAUSE IT WORK AS LOGIC.AND IT BUILT LOGIC.      
                                                                

                                                    GUYS PLEASE DO NOT COPY PASTE MY REASON TYPE THAT FROM MINE OTHERWISE IT WILL NOT GOING TO SAVE YOUR ANSWER.



                                        THANKYOU GUYS





Comments