1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
V125BC [204]
2 years ago
10

A lottery ticket contains five unique numbers. A set of unique numbers does not contain repeated elements. The winning combinati

on of this lottery is chosen by picking five unique numbers. Define a function matches(ticket, winners) that takes two lists and returns an integer that says how many numbers the two lists have in common.
Computers and Technology
1 answer:
RSB [31]2 years ago
6 0

Answer:

Answer explained below

Explanation:

I have given two approaches in implementing the solution.

1. Using the for loop, in which you have to iterate over all the elements in list 1 and check in list 2

2. Use the set intersection method. As intersection will give u the common elements. And we can get there length by using len method.

I have added the code along with the snapshot and inline comment for the ease of you to understand. Please check the methods below. You can use either of them.

METHOD-1:

********** CODE *****************

def matches(tickets,winner):

tickets = set(tickets)

winner = set(winner)

counter = 0 #To Count the common elements

for i in tickets: # Iterate over all the elements in tickets.

if i in winner: # Check the element in the winner list

counter = counter+1

return counter

METHOD -2:

********** CODE ********************

def matches(tickets, winner):

tickets = set(tickets)

winner = set(winner)

return len(tickets.intersection(winner))

You might be interested in
What block(s) would most effectively keep a sprite from moving off the screen?
Sonja [21]

The block most effectively keep a sprite from moving off the screen if if on edge, bounce. Hence option B is correct.

<h3>What is screen?</h3>

Screen is defined as a portable or stationary object that offers shelter, acts as a partition, etc., and often consists of a covered frame. Screening is defined as the procedure of locating or choosing individuals from a community according to one or more selection criteria.

The block will kept more perfectly if one of the edge there is bounce so that the box will not fall from the sprite.

Thus, the block most effectively keep a sprite from moving off the screen if if on edge, bounce. Hence option B is correct.

To learn more about screen, refer to the link below:

brainly.com/question/23902291

#SPJ1

8 0
1 year ago
A Uniform Resource Locator (URL) consists of three separate parts: network protocol, host, and web browser.
FrozenT [24]
That is false. are you doing it on a computer course.                                             <span />
3 0
3 years ago
Read 2 more answers
What is the purpose of the website directory provided by the website host?
Dennis_Churaev [7]

Answer:

mabye A

Explana

.

.

.

6 0
3 years ago
Password procedures, information encryption software, and firewalls are examples of measures taken to address:
Gnoma [55]
<span>Password procedures, information encryption software, and firewalls are examples of measures taken to address are all measures taken to safeguard information security and protect users data from being tampered or manipulated by invaders. 

In web, if we leave our information without encryption or if we leave our system without firewall, different types of security threats might arise: such as, information being hacked, manipulated or sent to wrong places. To avoid this information encryption is done. We might also need to firewall our system so that we can avoid unwanted access and invading of our privacy using malwares and other tools. </span>
5 0
3 years ago
Is It Safe to Use LinkedIn Automation?
Stolb23 [73]

Answer:

A lot of people have claimed that they lost their full-established accounts after using LinkedIn automation tools. LinkedIn detected the activity and blocked their accounts.  

But it’s not the tool that causes spam, it’s the approach you adopt while using these tools.  

Many people think that LinkedIn automation tools(LinkedCamp) can generate leads magically over the night. They send thousands of connection requests and messages using automation and as a result, LinkedIn detects their activity.  This is not how it works. You need a proper strategy to leverage the potential of these tools. Even the best LinkedIn automation tools cannot guarantee success if you try to overdo the activities.

6 0
3 years ago
Read 2 more answers
Other questions:
  • A typical, small, dry cell battery has a voltage of A. 6.0 volts. B. 1.0 volts. C. 12.0 volts. D. 1.5 volts.
    11·2 answers
  • On the 74ls74 d flip-flop, the clk input has a small triangle. the pr (preset) and clr (clear) inputs have a circle. what do the
    15·1 answer
  • The Windows Remote Desktop Web connection that allows users to connect to a work or home computer and access files is considered
    7·2 answers
  • An application with which you can perform calculations on numbers and work with other data
    8·1 answer
  • The smallest unit of storage is​
    15·1 answer
  • Given n ropes of different lengths, we need to connect these ropes into one rope. We can connect only 2 ropes at a time. The cos
    9·1 answer
  • In C complete the following:
    12·1 answer
  • me pueden ayudar con mi trabajo sii porfss si me dan la respuesta correcta y les doy la mejor coronita si​
    12·1 answer
  • Hello people, I was wandering if I could get some people to complete this questionnaire for my business course. It would be very
    5·1 answer
  • You are the Emergency Management Director of a small island nation. Your nation has come under Cyber-attack and the attackers ha
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!