Access over 35 million academic & study documents

Its320 mod 3 mastery ex attempt 1

Content type
User Generated
Rating
Showing Page:
1/5
Score for this attempt: 5 out of 10
Submitted Jan 18 at 12:16pm
This attempt took 10 minutes.
IncorrectQuestion 1
0 / 1 pts
The relational equality operator in Python is _________:
=
==
===
equal
Actually, look again. To test if two Python objects are the same, use this relational
operator.
See the relational operator table, Table 1, on Page I in Module 3 for more information.
IncorrectQuestion 2
0 / 1 pts
Let set a = set([1,2,3]) and set b = set([-1,-2,-3]). What is a | b?
set([])
set([0,0,0])
set([1,2,3])
set([1,2,3,-1,-2,-3])

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/5
Actually, look again. The “|” operator produces a set that contains the distinct elements
from both sets. The new set does not have any duplicate elements. See the code
examples on set operators in the “Membership Operators” section, Page II of Module 3
for more information.
Question 3
1 / 1 pts
To test whether an element is not a member of a list, what operator do you use?
in
not in
test
!in
Correct! Use the “not in” to check if an element is not in a list.
For example:
>>> prices = [‘$20’,14.99,5]
>>> print(15 not in prices)
True
Question 4
1 / 1 pts
True or false? Let A = False and B = False. What is “not(A and B) or not(A or B)”?
True
Correct! “A and B” is True. “not(A and B)” is False. “A or B” is False. “not(A or B)” is True. “False
or True” is “True.”
False
IncorrectQuestion 5
0 / 1 pts
What is the console output of the following Python statement: print(0 or -1) ?
-1

Sign up to view the full document!

lock_open Sign Up
Showing Page:
3/5

Sign up to view the full document!

lock_open Sign Up
End of Preview - Want to read all 5 pages?
Access Now
Unformatted Attachment Preview
Score for this attempt: 5 out of 10 Submitted Jan 18 at 12:16pm This attempt took 10 minutes. IncorrectQuestion 1 0 / 1 pts The relational equality operator in Python is _________: = == === equal Actually, look again. To test if two Python objects are the same, use this relational operator. See the relational operator table, Table 1, on Page I in Module 3 for more information. IncorrectQuestion 2 0 / 1 pts Let set a = set([1,2,3]) and set b = set([-1,-2,-3]). What is a | b? set([]) set([0,0,0]) set([1,2,3]) set([1,2,3,-1,-2,-3]) Actually, look again. The “|” operator produces a set that contains the distinct elements from both sets. The new set does not have any duplicate elements. See the code examples on set operators in the “Membership Operators” section, Page II of Module 3 for more information. Question 3 1 / 1 pts To test whether an element is not a member of a list, what operator do you use? in not in test !in Correct! Use the “not in” to check if an element is not in a list. For example: >>> prices = [‘$20’,14.99,5] >>> print(15 not in prices) True Question 4 1 / 1 pts True or false? Let A = False and B = False. What is “not(A and B) or not(A or B)”? True Correct! “A and B” is True. “not(A and B)” is False. “A or B” is False. “not(A or B)” is True. “False or True” is “True.” False IncorrectQuestion 5 0 / 1 pts What is the console output of the following Python statement: print(0 or -1) ? -1 0 True False Actua ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Anonymous
Nice! Really impressed with the quality.

Studypool
4.7
Indeed
4.5
Sitejabber
4.4