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
postnew [5]
3 years ago
14

Write a program that reads in 10 numbers and displays the number of distinct numbers and the distinct numbers in their input ord

er and separated by exactly one space (i.e., if a number appears multiple times, it is displayed only once). After the input, the array contains the distinct numbers. Here is a sample run of the program.
Computers and Technology
1 answer:
Alla [95]3 years ago
8 0

Answer:

Explanation:

The following code is written in Python. It creates a for loop that iterates 10 times, asking the user for a number every time. It then checks if the number is inside the numArray. If it is not, then it adds it to the array, if it is then it skips to the next iteration. Finally, it prints the number of distinct numbers and the list of numbers.

numArray = []

for x in range(10):

   num = input("Enter a number")

   if int(num) not in numArray:

       numArray.append(int(num))

print("Number of Distince: " + str(len(numArray)))

for num in numArray:

   print(str(num), end = " ")

You might be interested in
Which of the following is true about ethical issues in graphic design?
Basile [38]

Answer: The Answer Is B

Explanation:

I Did It On Edge

3 0
2 years ago
Read 2 more answers
why is it important for young people to start saving early as possible given the principles of interest?
hjlf
<span>Saving at a young age could be a really great investment on your future from years from now. It has several benefits like learning how to handle your money properly, investing to grow your money more and an early retirement with a lot of coins in your pocket for when you want to enjoy traveling more.</span>
5 0
3 years ago
Read 2 more answers
Convert the following as indicated : (120)10 = (?)2​
Nookie1986 [14]

Answer:

1111000

Explanation:

perform the following. write from right to left:

- is the number even? then write down a 0

- is the number odd? then write down a 1 and subtract 1

- divide by 2

- repeat until you reach 0.

So for 120:

120 is even, so write down a 0 and continue with 120/2=60

60 is even,  so write down a 0 and continue with 60/2=30

30 is even,  so write down a 0 and continue with 30/2=15

15 is odd,  so write down a 1 and continue with 14/2=7

7 is odd, so write down a 1 and continue with 6/2=3

3 is odd, so write down a 1 and continue with 2/2=1

1 is odd, so write down a 1 and finish with 0

4 0
2 years ago
Employees are one of the main contributors to cybersecurity breaches because of _____? Select 3 options.
Tema [17]

Answer: inattention, lack of knowledge, and negligence.

Explanation: employees are often the cause of workplace incidents because they may be unknowledgeable about security protocols, negligent, or simply make a mistake.

5 0
2 years ago
Who designed the Analytical Engine in the 1830s? Alan Turing Alan Turing Charles Babbage Charles Babbage Bill Gates Bill Gates S
Dmitriy789 [7]
Charles Babbage Charles Babbage
7 0
1 year ago
Other questions:
  • Your company is developing a new marketing campaign and wants to know which customers have never placed an order. You will need
    10·1 answer
  • What might be the best response to a cyberbuly attack
    6·2 answers
  • What were precomputed tables and why were they necessary?​
    12·2 answers
  • A _________ is a copy of one or more files (or entire storage devices) that is made in case the originals become lost or damaged
    5·1 answer
  • How does classless inter-domain routing (cidr) help reduce waste of ip addresses?
    8·1 answer
  • Drag each label to the correct location on the image.
    10·1 answer
  • .Write a C++ program that displays your name and address (if you value your privacy, a fictitious name and address).
    9·1 answer
  • 4.11 lesson practice edhesive
    8·2 answers
  • Programmers use an Integrated Development Environment (IDE) to write software programs, because:
    10·1 answer
  • When we look for errors inside of our code on our own or with a partner , what is that called?
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!