(Print distinct numbers) Write a program that reads in integers separated by a space in one line and displays distinct numbers in their input order and separated by exactly one space (i.e., if a number appears multiple times, it is displayed only once). Hint: Read all the numbers and store them in list1. Create a new list list2. Add a number in list1 to list2. If the number is already in the list, ignore it.

Answers

Answer 1

Answer:

Following are the program to the given question:

num = input("Enter numbers: ")#defining a variable num for input value  

list1 = num.split()#defining a list1 that adds value in list1  

list2 = []#defining an empty list list2

for j in range(len(list1)):#defining a for loop that checks the list value in range  

   if not list1[j] in list2:# use if block that checks multiple value

       list2.append(list1[j])#add value in list2

print("The distinct numbers are: ")#print message

for j in range(len(list2)):#defining for loop for print list value

   print(list2[j])#print list value

Output:

Enter numbers: 1 22 55 7 22 1 1 2 3

The distinct numbers are:  

1

22

55

7

2

3

Explanation:

In the above-code, a "num" variable is defined, that takes inputs from the console screen, and in the next step, "list1 and list2" is defined. In the "list1" it adds num variable value a into the list.

In the next step, a for loop is defined that checks the list value in range , and define an if block, that checks multiple value and add value into the list2, and in the next step, the for loop is defined that prints the list2 values.    


Related Questions

Here is a sequence of binary digits:
011000101110010100110100010001110101001110001010101
What could this sequence represent? What could it mean?

A. A piece of text
B. A number
C. A set of instructions
D. Musical notes
E. Any piece of information

Could I have some help please?

Answers

Answer:

E

Explanation:

trust me

why would computer programmers want to use an object to change the instructions they already created in a computer program ​

Answers

Answer:

bank rupt

Explanation:

no money on your card lol have  a graey day dont wish for what your not willing to work for

What are the differences between linear algorithm and iterative algorithm

Answers

Answer:

For example Tower of Hannoi algorithm is made easy by recursion while iterations are widely used, efficient and popular. Recursive vs Iterative Algorithms: Approach: In recursive approach, the function calls itself until the condition is met, whereas, in iterative approach, a function repeats until the condition fails.

Why is it a good practice to use functions in programming? Select the best answer.

A.It is faster to run the code using functions.

B.Functions allow us to reuse common code.

C.All of these are correct.

D.It is easier to debug the code using functions.

Answers

Answer:

C. All of these are correct answer from the options for the question that u have given...

The good practice to use functions in programming is all of these are correct. The correct option is C.

What are functions in programming?

The repetitious codes are removed by breaking a program down into functions, which not only reduces the size of the program but also improves its effectiveness. If there were repetitive codes, we would need to alter the program from several locations rather than just one.

As a result, organizing programs into functions aid in good administration and shortens programs by removing repeated code. A functional programming language is a particular kind of language that allows for the creation and application of pure mathematical functions, along with the use of conditional expressions and recursion to carry out various computations.

Therefore, the correct option is C. All of these are correct.

To learn more about functions in programming, refer to the link:

https://brainly.com/question/24297344

#SPJ6

Which of these is not a common type of programming design?
~object-oriented design
~structured programming design
~graphic design
~top-down programming design

Answers

Answer:

structured programming design.

Explanation:

Answer:

I can confirm its structured programming design

Explanation:

how do you do the ask tutor thing on the computer?

Answers

Answer:

what do you mean

Explanation:

Two friends can share 100 songs from their Bluetooth enabled mobile devices
a. True
b. False
c. They need internet connection
d. Not sure

Answers

Answer:

A

Explanation:

If they are connected via bluetooth, you can share unlimited amounts of anything.

which type of hazzard are those substances which threathen you physical safety ?​

Answers

Answer:

98o

Explanation:

Lin wants to play an online game with her friends. She read the description of the game and knows it contains several features with addictive design, including rewards for completing levels and long game times with penalties for quitting early. She likes the game but doesn’t want to get sucked in and skip her homework (which has happened before)! Name two guidelines Lin should set for herself before playing the game.

Answers

Answer:

Set a time limit for herself. Ask her parents for help monitering her app usage.

What is the purpose of HTML?
A. to store data
B. to structure a document
C. to style a document
D. to add functionality

plz it a test

Answers

You can style and structure with it so it’s either one of those

definition of data redundancy​

Answers

Answer:

Data redundancy occurs when the same piece of data exists in multiple places, whereas data inconsistency is when the same data exists in different formats in multiple tables. Unfortunately, data redundancy can cause data inconsistency, which can provide a company with unreliable and/or meaningless information

ayo which one is better genshin impact or fortnite, i personally prefer genshin impact since it's not boring and it has so many other things you could do when you're not doing a story quest or daily commissions

Answers

Answer:

Genshin Impact and you can fight me on it.

Explanation:

The game has way more to explore and offer with different fighting styles which include Magic and Swords fighting. It also has more story and I appreciate that!  

The side quests to get tedious though so the final rating  is 8.79//10.00

Answer:

genshin

Explanation:

Imagine you are playing a video game like Super Mario or Sonic and you lose your last life. What are THREE distinct things that will happen once your lives become 0? Give three examples. Then put on your programmer's hat. Describe your examples using pseudocode; in other words, you don't have to use the exact language Scratch blocks would, as long as you write out each step in such a way that it's clear what the code would do.

Answers

Answer:

Three distinct things that would happen are

1) There would be a death animation played

2) GAME OVER text would appear

3) The game would most likely start over at the first level

Explanation:

The pseudocode:

1) Play death animation and music

2)Stop animation and music

3) Display Game over text

4) Remove game over text

5) Reset level

6) Open on beginning screen/level

True or false: Machine learning lets computers
learn how to do things they weren't
specifically programmed to do.

Answers

Answer:

True

Explanation:

Which are the following 4 things something must be able to do in order to be a computer? *

Answers

Answer:

There are four main equipment functions of a computer system: Input, Processing, Storage and Output.

Explanation:

Where are methods listed in a UML class diagram showing three parts?
in the top third of the diagram
in the middle third of the diagram
in the bottom third of the diagram
anywhere in the diagram a lowercase m is shown

Answers

Answer:

the bottom third

Explanation:

Check out the exampe below.

swim() would be an example of a method.

Write a C++ program to add two integers. Make a function add() to add integers and display sum in main() function.

Answers

Answer:

In C++:

#include <iostream>

using namespace std;

int add(int a, int b){

   int c = a + b;

   return c;

}

int main(){

   int a, b;

   cout<<"Enter two numbers: ";

   cin>>a;

   cin>>b;

   cout<<add(a,b);

   return 0;

}

Explanation:

The add() function begins here

int add(int a, int b){

This adds the two integers

   int c = a + b;

This returns the sum of the two integers

   return c;

}

The main begins here

int main(){

This declares two numbers

   int a, b;

This prompts user for two numbers

   cout<<"Enter two numbers: ";

The next two lines gets the two numbers

   cin>>a;

   cin>>b;

This gets the sum of the two numbers from the add() function. The sum is also printed

   cout<<add(a,b);

   return 0;

}

* EMAIL*

What do you type in the “recipients” box

(A) The title of your email/summary of what you need

(B) The persons name you are sending an email to

(C) The question you are asking

Answers

Answer:

The correct answer is: (B) The persons name you are sending an email to.

Explanation:

"Recipients" are the people receiving the email whether it be one or multiple people. Those are the people that will be getting your email on whatever your sending your email about. Hope this helps you! :D

You learned that you can use the tags to insert a link to another webpage. One problem that webpage developers face is that, after a time, links may no longer work. Can you think of ways that you can avoid broken links?

Answers

Answer:Image Control

We can use the height and width properties to control the size of our image. Let’s say we only want the recipe image to take up approximately one-third of the page. Do you remember from math class what percentage one-third is? Type in the following CSS rule, and watch your picture change size before your very eyes!

img {

   height:33%;

   width:33%;

}

That wasn’t too difficult, right? Let’s make the image stand out a bit more by adding a border. Inside the img rule, add the following declarations:

border-style:dashed;

border-width: 5px;

Your picture should now have a dashed border around it that is five pixels in width. Play around with the different border styles that are available. You should see a drop-down box of choices, including dotted, dashed, double, groove, inset, and outset. You can also adjust the width of your border. Using your informative guessing skills, can you predict what property you might use to change the color of the border? Try it and see if you’re right!

Explanation:

 this is a direct quote from my lesson

1 Sales tax
5.00%
Use the image to help you answer the question.
Which formula will tell you the total "Before tax"
price using cell references?

A. =3+2+50
B. =B8
C. =B4+B5+B6
D. =B4*B5*B6

Answers

Answer:

Future value (FV) tells you the value in the future of money deposited in a bank account ... We can use Excel to make a table of how the future value grows with the ... 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. A. B. C. D. E. F. Interest. 6% ... To answer the question, we compute the IRR of the investment and compare it.

Explanation:

Answer:

C. = B4+B5+B6

Explanation:

Edge 2020

What is the Denary representation of this 8 bit number > 01001111 ?

Answers

The Denary representation of this 8 bit number 01001111 is 79.

Decimal number

A binary number is a number expressed in the base-2 numeral system or binary numeral system. Binary numbers are either 0 or 1.

The decimal numeral system is the standard system for denoting numbers. Decimals are a set of numbers lying between integers on a number line.

Converting the number 01001111 to decimal:

01001111 = (0 * 2)⁷ + (1 * 2)⁶ + (0 * 2)⁵ +  (0 * 2)⁴ +  (1 * 2)³ +  (1 * 2)² + (1 * 2)¹ + (1 * 2)⁰ = 79

The Denary representation of this 8 bit number 01001111 is 79.

Find out more on Decimal number at: https://brainly.com/question/1827193

Use the drop-down menu to complete the steps for using the Goal Seek feature.
1. Go to the
tab.
2. In the
from the drop-down What-If Analysis menu.
3. Specify the cell that contains the formula to solve and enter the desired result.
4. Specify the
that contains the value to adjust.
5. Click OK
group, select

Answers

Answer:

1. Go to the  data tab.

2. In the  forecast ribbon from the drop-down What-If Analysis menu.

3. Specify the cell that contains the formula to solve and enter the desired result.

4. Specify the  changing cell that contains the value to adjust.

5. Click OK

Answer: see below

Explanation:

if you hard working right now go to this EASY question


#BRAINLY and I will give you brainlist something I forgot what's it called for your hard work

Answers

Ok, where is the question so I can try my best?
Whats the question??? Lol

Someone please tell me what lambda does! in python!! I need help

Answers

Answer:Lambda Technologies is the he is the group name encompassing a Premier materials research laboratory with an engineering and production enterprise dedicated to the development and optimization of of surface treatments our company has been selling materials for over four decades with over 150 years of combined experience in more than 20,000 research programs we are proud of our corporate legacy in record or around standing performance in meeting or customers needs room training all excellence groundbreaking innovation and committed hard-working employees we are able to provide more than just data we provide complete service enhancement solutions are resources that can include all of our technical papers he studies defraction notes and downloads we are a well known source of research in education materials on the understanding measurement and controls of residual stress

Explanation:

Other Questions
Solve for x.Your Answer:Question 3 options:Answer HELP ME I WILL GIVE BRAINIST AWANERR AND On a separate sheet of paper, choose three animals, one that lives in water, one that lives onland, and one that flies. Explain how each one moves and how it is uniquely adapted formovement within its environment. Change the following sentence into negative and interrogative :a)We need a teacher .b) She can speak 5 languages.c) I work in Bristol .d)You can play tennis Consider the function p(t) show.identify the intervals on which the function appears to be in increasing help please- What is the difference in the simplest form? In a population of 2000 students, 230 are left-handed. A random sample of size50 is selected and the number of left-handed students is recorded. If wecollected many more samples, which of the following could describe thesampling distribution? Do you agree with the claims that Washington's most important act was the voluntary giving up of thePresidency? Explain and justify your position. Can anyone help me pls??? 6. A piece of carpet is 240cm long. Mr Jones cuts it into three pieces in the ratio 1 : 2 : 5 Work out the length of the longest piece of carpet. Does anyone know how to cure someone with belly/stomach aches? Mine hurts right now, I know what to do so if your answer is correct I will heart, rate 5 stars, and brainliest. So the first 2 that answers... Good luck!! :))) which linear any qualities could represent the given table of values lobal wind patterns have less to do with air temperature than local winds. A True B False Although Thomas Jefferson believed in equality, he stillA. was poor.B. owned slaves.C. respected the king.D. thought women should vote. By expanding the empire and reorganizing the military and government to make it safeand strong, Augustus Caesar created a new era of prosperity that lasted 200 years calledthea. Pax Romanab. Golden Yearsc. Pax Augustusd. Age of Prosperity HELP ASAP!!Which scenario is an example of an environmental problem becoming aneconomic problem?O A. Excessive pollution decreases a community's access to affordableclean water.O B. Destruction of habitat reduces a population of animals in a remoteecosystem.O C. Deforestation creates farmland that allows a community toproduce more crops.O D. Excessive manufacturing of a product reduces demand in asaturated market. Function 1 is defined by the equation p= --3/2r - 5. function 2 is defined by the following table. Which function has a greater y-intercept. A: Function 1 B: Function 2 C: The functions have the same y-intercept. How can the freezing of surface waters make the water that is left unfrozen denser What do you think is the most significant event that occurred in act two of othello? 11. How much longer is the Canada goose egg than the raven egg? 12. How much wider is the turtledove egg than the robin egg? Write an equation, in standard form, using the following given info: M = 10and it passes through the point (6,2) * -10x + y = -58 -10x + y = 58. -10x - y = -5810x + y = -58