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
Art [367]
3 years ago
12

We will pass you 2 inputsan list of numbersa number, N, to look forYour job is to loop through the list and find the number spec

ified in the second input. Output the list element index where you find the number.If N is not found in the list, output -1.Tip: Remember the break statement? It exits the loop. You can (but don’t have to) use this.# Get our input from the command lineimport sysN= int(sys.argv[2])# Convert the list of strings into integersnumbers= []for i in sys.argv[1].split(","):if(i.isdigit()):numbers.append(int(i))# numbers now contains the list of integers# Write your code below
Computers and Technology
1 answer:
Montano1993 [528]3 years ago
4 0

Answer:

The Python code is given below

Explanation:

# Get our input from the command line

import sys

N = int(sys.argv[2])

# Convert the list of strings into integers

numbers= []

for i in sys.argv[1].split(","):

   if(i.isdigit()):

       numbers.append(int(i))

# numbers now contains the list of integers

f = False

#Use for loop upto len(numbers)

for i in range(0,len(numbers)):

   #Use "if" loop to check

   if numbers[i] == N:

       #Assign "True" to "f"

       f = True

       #Display "i"

       print(i)

       break

#Check "if" loop by assigning "false" to "f"

if f==False:

   #Print "-1"

   print("-1")

You might be interested in
Is the number of hits to a website in a daynumber of hits to a website in a day a discrete random​ variable, a continuous random
marissa [1.9K]

Answer:

The correct answer to the following question will be "It is a discrete random variable".

Explanation:

A variable that assumes algebraic expressions defined by a randomized occurrence result, is a Random variable.

  • There are several potential or possible values for a single randomized variable.
  • A discrete random variable's chances for each value is between 0 (zero) and 1 (One), as well as the total amount among all possible outcomes, is equitable to 1.

So, a Discrete random variable is the right answer.

3 0
3 years ago
Read 2 more answers
Which statement describes part of the meeting scheduling process? It is always an all-day event. It is created in a single calen
olga nikolaevna [1]

Answer:

is there a pic or something, sorry i cant help at the time being

Explanation:

5 0
2 years ago
Two systems are connected by a router. Both systems and the router have transmission rates of 1,000bps. Each link has a propagat
Lisa [10]

Answer:

Two systems are connected by a router. Both systems and the router have transmission rates of 1,000bps. Each link has a propagation delay of 10ms. Also, it takes router 2ms in order to process the packet (e.g. decide where to forward it). Suppose the first system wants to send a 10,000 bit packet to the second system. How long will it take before receiver system receives the entire packet.

Transmission time for first Router = 10,000 bits / 1000 bps = 10 seconds

Receiving time for seond route r= 10,000 bits / 1000 bps = 10 seconds

Propagation delay = 10ms = .01 seconds x 2 for two delays = .02 seconds

First router 2ms to process = .002 seconds

Add all the times together and we get 20.022 seconds which is the same as or 20 seconds and 22 ms

4 0
2 years ago
What is the job title of someone who works with video and/or film?
boyakko [2]
Producer, videographer
4 0
3 years ago
Just take points, this website is so weird because of all the reporting and I didn't do any thing
krok68 [10]

Answer:

I agree with you! And thank you for the points

Explanation:

I answer educational questions and ask one of my own regarding math and it gets reported

Someone asked if their art was good and how they can improve it and it gets reported

But the only questions they don’t report are free po!nts

For the people who don’t have anything better to do then report people trying to get help: STOP ITS ANNOYING NOT JUST FOR ME BUT THE PEOPLE WHO ARE TRYING TO GET HELP, INSTEAD OF REPORTING WHY DONT U HELP PEOPLE???

7 0
2 years ago
Read 2 more answers
Other questions:
  • To set up a slide show you should do all of the following except ______.
    9·1 answer
  • What is required to display content on transparencies?
    6·1 answer
  • Which member of the restaurant and food/beverage service career is mostly likely to plan menus and direct worker
    6·2 answers
  • what key aspects did you learn regarding the creation, analysis, and management of information systems? How will this impact you
    5·1 answer
  • WHAT IS A COMPUTER ????
    14·2 answers
  • write the algorithm, flowchart and BASIC program to calculate the area of the rectangle length 50m and width 30m.​
    8·1 answer
  • Which tab is used to insert a hyperlink onto a slide?
    9·1 answer
  • 11) A single inheritance model means: * A) A class can only have one parent class (superclass) B) A class can only have one chil
    7·1 answer
  • Discuss the role of the concept behind the "Internet of Things (IoT)" in today's digitally connected society.
    11·1 answer
  • Which of the following is true about parallel computing performance?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!