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
Janet received an email from a bank asking for the password for her Internet banking account. She emailed back her password. A f
Tcecarenko [31]
Probably a phishing scam

asks for personal information claiming to be a person from a legitimate bank
6 0
3 years ago
Read 2 more answers
What aspects of your life are most influenced by media and technology​
Anastasy [175]

Answer:

Everyday life

Explanation:

Television

office work (computers )

Music

video games

ware house work uses technology

work from home jobs use technology

cellular towers

5 0
2 years ago
What does it mean to read visual and audio text
Ymorist [56]

To find meaning and decipher relationships between symbols and information


Talking books could be a means to automatize and generalize such an audio–visual reading experience. ... RWL consists of an experimental reading situation where one reads a text while one can hear it said aloud by a pre-recorded speaker or by a text-to-speech system.

8 0
3 years ago
What is a guardian node summary for theta staking tool
Diano4ka-milaya [45]

Answer: Theta Guardian

Explanation:

THETA is used to stake as a Validator or Guardian node, contributing to block production and the protocol governance of the Theta Network. By staking and running a node, users will earn a proportional amount of the new TFUEL generated. Relayers earn TFUEL for every video stream they relay to other users on the network.

3 0
2 years ago
HELP ME PLEASE !!!!!!!!!!
Snezhnost [94]

Answer:

the last one

Explanation:

8 0
3 years ago
Other questions:
  • In an is framework, ________ is the bridge between the computer side on the left and the human side on the right
    12·1 answer
  • A mobile device has stopped receiving automatic OS updates that until recently were pushed to the device.
    7·2 answers
  • Cual es la herramienta de google que funciona como oficce ?
    11·1 answer
  • Select one or more of the following: Which of these events will cause signal(s) to be generated by the kernel (the operating sys
    6·1 answer
  • Which sentence is an example of an I-statement?
    6·1 answer
  • I want to get an output picture in python but it says this. I'm using turtle
    12·1 answer
  • Will, there be any presents this year
    15·1 answer
  • A non-profit organization decides to use an accounting software solution designed for non-profits. The solution is hosted on a c
    11·1 answer
  • You want to send an email to members of your team working on a school project. In which field would you put the email addresses
    13·1 answer
  • Question 7 (1 point)
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!