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

which city is found at 18°s latitude and 69°w longitude
please please please help me thanks
your cousin posted a link to an article with an incendiary headline on social media. what action should you take?
With the recent impeachments of former President Trump, do you believe impeachment is an effective means to hold a President accountable? (Make sure to describe
Which equation represents fertilization? haploid diploid = diploid diploid haploid = haploid haploid haploid = diploid diploid diploid = diploid.
Eight equals r to the power of two
Which statement describes the density of the inner planets?
Fungsi f(x) = x³ - 12x² + 45x -18 merupakan fungsi naik pada interfal
Write a story that ends never will I do that
HeLP ASAP worth many points No random answer or get reported Answer ALL THREE