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
kari74 [83]
2 years ago
7

Overview

Computers and Technology
1 answer:
ludmilkaskok [199]2 years ago
5 0

Answer:

the answer is in the image below:

Explanation:

You might be interested in
Write a program that asks the user how many numbers will be entered and then has the user enter those numbers. When this is done
KATRIN_1 [288]

Answer:

<em>The program written in Python 3 is as follows;</em>

<em>The program does not make use of comments; however, see explanation section for detailed line by line explanation of the program</em>

num = int(input("Number of Inputs: "))

mylist = []

userinput = int(input("Enter a digit: "))

i = 1

while i < num:

     mylist.append(userinput)

     userinput = int(input("Enter a digit: "))

     i += 1

   

try:

     first7 = mylist.index(7)+1

     print('The first position of 7 is ',first7)

     last7 = num - 1 - mylist[::-1].index(7)

     print('The last position of 7 is ',last7)

except:

     print('7 is not on the list')

Explanation:

This line prompts user for the number of inputs

num = int(input("Number of Inputs: "))

This line declares an empty list

mylist = []

This line inputs the first number into the empty list

userinput = int(input("Enter a digit: "))

The italicized lines represent an iteration that allows user to input the numbers into the empty list.

<em>i = 1</em>

<em>while i < num:</em>

<em>      mylist.append(userinput)</em>

<em>      userinput = int(input("Enter a digit: "))</em>

<em>      i += 1</em>

The try-except is used to check the presence of 7 in the list

try:

This checks the first occurrence of 7

     first7 = mylist.index(7)+1

This prints the first occurrence of 7

     print('The first position of 7 is ',first7)

This checks the last occurrence of 7

     last7 = num - 1 - mylist[::-1].index(7)

This prints the last occurrence of 7

     print('The last position of 7 is ',last7)

The following is executed if there's no occurrence of 7

except:

     print('7 is not on the list')

See Attachments for sample runs

7 0
3 years ago
Select the correct line of missing code to create an output of "hello."
s2008m [1.1K]

Answer:

B

Explanation:

This feels like an error on the question issuer's part.

3 0
2 years ago
Help please! I need help with this question, it’s very hard.
sasho [114]

Answer:

1. PRINTER

2.Proj

3.USB

4.CAM

7 0
3 years ago
Circuitry can be either basic or ___________.
Sonja [21]
I think it would be A. Ohm's law.
hope this helps.
6 0
3 years ago
Read 2 more answers
How many numbers can be represented with 2,3,4,8 bits?
MrRa [10]
Image that a bit is the smallest measure in programming, such as an elementary particle in physics. So, a bit can only fit one number.
5 0
3 years ago
Other questions:
  • He would like to get rid of the graph. What will accomplish
    8·1 answer
  • List two ways that guest could be defined
    12·2 answers
  • A strategic business unit​ (SBU) of a major corporation has high market share in its​ industry, but the growth rate of the indus
    8·2 answers
  • Many inventions have enabled us to use digital cameras. The biggest difference between traditional and digital cameras is that d
    10·1 answer
  • State 4 basic operation performed by a computer​
    11·2 answers
  • What code would you use to create the login button?
    11·1 answer
  • Define a function below, filter_out_strs, which takes a single argument of type list. Complete the function so that it returns a
    10·1 answer
  • What is pollution?
    14·2 answers
  • Select the correct answer..
    6·1 answer
  • What happens when you create a variable in a video game program?​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!