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
a client has requested adjustments to the arrangement and placement of elements on an image. what does the client want changed?
qaws [65]

Considering the situation described above, the client wants the <u>image's recipe to be changed.</u>

<h3>What is the Image Recipe?</h3>

Image Recipes are characteristics of an image or picture. It includes features like shape, size, form, pattern, line, shadow, tone, color, contrast, positive space and negative space, etc.

Given that the client needs adjustments to the arrangement and placement of elements on an image, this is a request for a change in the image recipe.

Hence, in this case, it is concluded that the correct answer is "<u>the client wants the recipe of the image changed."</u>

Learn more about the Image Recipe here: brainly.com/question/1605430

6 0
2 years ago
How can you tell if your car is overheating?
Nitella [24]
A) your temp gauge is moving into red
4 0
3 years ago
Read 2 more answers
What are the main techniques used to help manage test anxiety? Check all that apply.
Aleks04 [339]

Answer:

1) Avoid the perfectionist of trap

2)Banish the negative thoughts

3) Get enough sleep

4) Make sure you are prepared

5) take deep breaths

Explanation:

In my thought it's the answer of this question.

4 0
2 years ago
Read 2 more answers
Which of the following URL extensions indicate the website is used by a college or university?
Svetllana [295]
The answer is (D) - .edu
4 0
3 years ago
Read 2 more answers
Which item is used for formatting in responsive web design? Adding horizontal scroll Adding interesting text Improving image qua
vivado [14]

Answer:

3) Improving image quality

8 0
3 years ago
Other questions:
  • What type of data visual would you use to illustrate trends over time? Gantt chart Bar graph Line chart Scatter diagrams
    5·1 answer
  • All of the following are vertical alignment options except __middle , top, center, or_bottom_.
    12·1 answer
  • Use the drop-down menu to identify which command is used to do the activities.
    10·1 answer
  • Please answer this correctly what’s the answer opening modify style dialog box enables you to
    8·1 answer
  • For this scenario related to turtle drawing, indicate whether it is better to write a loop or a function (or a set of functions)
    13·1 answer
  • The average price of milk increased from $3.00 last year to $3.50 this year. This is most likely due to:
    14·1 answer
  • Python: Bad input on line 8. What is the fix, please can someone tell me I’m desperate?
    10·1 answer
  • Strengths and weaknesses about esport
    10·1 answer
  • If you're driving a car and know there's a motorcyclist around you, you should______. A. Not change your driving B. Check your b
    11·1 answer
  • Define two benefits to members of the community of replacing the printed copy with an online version.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!