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
vlabodo [156]
3 years ago
9

Finish the code to search for a 7 in the array.

Computers and Technology
1 answer:
guapka [62]3 years ago
8 0

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))

You might be interested in
Write a program that uses the function isPalindrome given in Example 6-6 (Palindrome). Test your program on the following string
Artist 52 [7]

Answer:

#include <bits/stdc++.h>

using namespace std;

bool isPalindrome(string str)

{

   char a,b;

int length = str.length();

for (int i = 0; i < length / 2; i++)

{

   a=tolower(str[i]);//Converting both first characters to lowercase..

   b=tolower(str[length-1-i]);

   if (b != a )

return false;

}

return true;

   

}

int main() {

   string t1;

   cin>>t1;

   if(isPalindrome(t1))

   cout<<"The string is Palindrome"<<endl;

   else

   cout<<"The string is not Palindrome"<<endl;

return 0;

}

Output:-

Enter the string

madam

The string is Palindrome

Enter the string

abba

The string is Palindrome

Enter the string

22

The string is Palindrome

Enter the string

67876

The string is Palindrome

Enter the string

444244

The string is not Palindrome

Explanation:

To ignore the cases of uppercase and lower case i have converted every character to lowercase then checking each character.You can convert to uppercase also that will also work.

6 0
3 years ago
Where is an exploratory robot used?
Allisa [31]
The answer is the moon, mars, etc.
6 0
3 years ago
Read 2 more answers
The rule of thumb that predicts that the number of transistors on a cpu will double every two years is called ________ law.
ivann1987 [24]
The rule of thumb that predicts that the number of transistors on a CPU will double every two years is called Moore's law.<span> The father of the Moore's law is Intel co-founder Gordon </span>Moore in 1965. This law states that <span>the number of transistors per square inch on integrated circuits had doubled every year since their invention.</span>
7 0
3 years ago
A two-way set-associative cache has lines of 16 bytes and a total size of 8 kB. The 64-MB main memory is byte addressable. Show
Dennis_Churaev [7]

There are 64 bytes in one cache. Since there are 256 bits for data.Thus,there are 256 sets of 2 lines in a cache memory each. total 8 bits are required to identify the number of set number.For the 64 Mbyte main memory, a 26-bit address is needed. For the 64-MB main memory which consists of 2^22 cells.Therefore, the bits for set plus tag length would be 22 bits, tag length is 14 bits and the word field length is 4.

Explanation:

1 cache = 64 bytes

16 bits for "tag" and 256 bits (32 bytes) for data.

4 0
3 years ago
You just hit the jackpot today because if you answer all these questions for me, and get it right you will be marked as brainlie
Mnenie [13.5K]

what colors a carrot -i -i think it's a carrot

6 0
3 years ago
Read 2 more answers
Other questions:
  • Tricia listed her assets and liabilities. Credit Card Bill Car Loan Bonds Piano Bank Account Bicycle Which are Tricia’s liabilit
    8·2 answers
  • Gave me six external part of the computer system and identify which is the output and input devices
    12·1 answer
  • Write a Qbasic program to read the value of base and height of a triangle and find its area. ​
    10·1 answer
  • In a typical e-mail address the host is
    14·1 answer
  • List two functions of the UPS​
    10·1 answer
  • HELP ME !!!!!!!
    15·1 answer
  • ก
    6·2 answers
  • Which wireless specification can connect to a school's WLAN and connect to multimedia display projectors wirelessly?
    7·1 answer
  • which network component connects a device to transmission media and allows the device to send and receive messages?
    7·1 answer
  • Word wrap is the same as __________ return and means you let the ______________ control when it will go to a new line.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!