alltimeballin alltimeballin
  • 03-01-2021
  • Computers and Technology
contestada

Finish the code to search for a 7 in the array.
from array import *
myArr = array('f',[3, 5, 7.3, 10])
location = myArr.
(7)

Respuesta :

MrRoyal
MrRoyal MrRoyal
  • 08-01-2021

Answer:

The complete code is as follows:

from array import *

myArr = array('f',[3, 5, 7,3, 10])

location = myArr.index(7)

print(str("7")+" is at position "+str(location+1))

Explanation:

I made corrections to the third line of the code and I added a line

This line gets the index of 7 from the array myArr using the index keyword

location = myArr.index(7)

This line prints the position of the 7 in the array

print(str("7")+" is at position "+str(location+1))

Answer Link

Otras preguntas

HOW TO FIND THE MISSING NUMERATOR IN ANY FRACTIONS LIKE 4/8=  ?/4
how does.debate in the senate differ from debate in the house?
The discovery of gold in Transvaal contributed to the start of _____?the Anglo-Boer WarWorld War IIWorld War Ithe Peloponnesian War
what is the prefix of enactment?
If item costs $99.99 with 15% off and I get final price. It then asks me what percentage of savings. How do I get the percentage of savings
At a store , 24 bottles of water and 6 bags of chips costs $23.40. Five bottles of water and two bags of chips cost $6.60. What is the cost of a single bottle o
Type of picture Paul Revere made of the Boston massacre?
how do you now 11/33 is a simplest form
What is the property, transformation, or simplification used in each step of this problem?    x-7=34
what is the prefix of enactment?