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
What is the argument in this function =AVERAGE(F3:F26)
monitta
The argument for the function would be answer "D".
5 0
3 years ago
Derek needs to shift from his desk to a new work area in his office. Which ergonomic principle should he follow while moving his
Paul [167]

Answer:

One should be in neutral posture, which is the ergonomic principle that needs to be followed while moving our belongings from one location to the other. Its because in this position the work done is zero, and hence we never lose any energy. And this is the posture you should ensure while you are working. Also, the goods packed when moved in this manner, has least chance of wear and tear. Thus, the goods remain safe.

Also, Derek should keep things in a box with padding and then lift to move them to the new work area.

Explanation:

The answer is self explanatory.

3 0
3 years ago
Which of the following expressions yields an integer between 0 and 100, inclusive? Question 5 options: (int)(Math.random() * 100
Alex17521 [72]

Answer:

(b) (int)(Math.random() * 101)

Explanation:

Given

min = 0 --- minimum

max =100 --- maximum

Required

Java expression to generate random integer between the above interval

The syntax to do this is:

(int)(Math.random((max - min) + 1) + min)

Substitute the values of max and min

(int)(Math.random((100 - 0) + 1) + 0)

Simplify the expression

(int)(Math.random(100 + 1) + 0)

(int)(Math.random(101) + 0)

(int)(Math.random(101))

Hence, the right option is:

(b) (int)(Math.random() * 101)

3 0
3 years ago
Alice's Restaurant Supply offers a line of specialty food products to institutional
Illusion [34]

Answer:

1) the wireless standards that can be implemented are; IEEE 802.11a, IEEE 802.11b, IEEE 802.11g and IEEE 802.11n. The pros and cons are in the attachment

2) 802.11g can be implemented in alice's restaurant. This is because it provides the fastest speed and has a wide range which will not be easily disturbed by other devices

3) Please check the attachment

4) Please check the attachment.

Explanation:

3 0
3 years ago
File names should describe what is in the file in a few words
JulijaS [17]

Answer

File names should describe the content of the file.

Explanation

File names are set of words  which are used to uniquely identify computer files which are stored in a file system. This helps one to know the contents of the file which you want to find. When you name these file names you use necessary characters you use descriptive words so that you dont have hard times when searching for them. The naming also is determined by the file system you are using because different systems impose different restrictions on the length of the file names and the allowed characters within file names.

3 0
3 years ago
Other questions:
  • The program prompts the user to interactively enter eight batting averages, which the program stores in an array. The program sh
    9·1 answer
  • Odbc works on the ____ operating system.
    5·1 answer
  • A statement describing both the requirements that must be met by a product or process amd the ways in which satisfaction of the
    8·2 answers
  • Write a program that asks the user for three strings. Then, print out whether the first string concatenated to the second string
    8·1 answer
  • What type of backlighting receives dc power directly from a motherboard and doesn't use an inverter?
    11·1 answer
  • Several NEC® sections contain the requirement to size conductors and overcurrent devices at 100 percent of the noncontinuous loa
    15·1 answer
  • Aside from human user types, there are non human user groups. Known as account types, __________ are implemented by the system t
    10·1 answer
  • Select the correct answer.
    9·1 answer
  • If someone said to you, “Pseudocode is a waste of time! It’s just more work because you end up writing the same program twice,”
    8·1 answer
  • Consider the following declaration:
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!