Python Quiz 3


 Q:1. If  :- 

         A=set('python')

         B=set('programming')

         Then what will be the output of 

        print(A-B)?

Answer : 3. {'h','y','t'}

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

         count=40

         print(count>=30 and count<39)

Answer : 2. False

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

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

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

Answer : 1. False

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

Answer : 3. Both A and B

No comments:

Post a Comment