(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

explain irony and why its ironic in 300 words

Answers

I’m not sure if I can do it in 300 words but you could probably stretch this out if you try hard enough.

Irony is like when you say how much you hate planes then the first time you get on a plane it crashes. It’s like when you say something that you don’t like or you don’t want to happen and it ends up happening anyways or something around those means.

This is 181 words sorry I couldn't figure out what else to add...

Explanation:

Verbal Irony occurs when the speakers attention is the opposite of what he or she is saying. Dramatic Irony occurs when the audience knows a key peice of information that the characters in a play or story do not know. There are a few diffrent types of Irony but theses two are the main ones used. It's kinda like when in the Cask of Amontillado Montresor hates Fortunado and leads him into the catacombs to kill him. There was a lot of Verbal and dramatic Irony. Verbal irony is created as the pair journey into the catacombs. Fortunado has a cough, and Montresor asks him to "return," or go out of the catacombs a few times. Fortunado continues in the hopes of sampling the amontillado. After Montresor chains Fortunado to the wall, he says, "Once more, let me implore you to return. No?" This is ironic because Montresor has no intention of letting Fortunado go. Another good representation of Dramatic Irony would be in Romeo and Juliet when the audience knows that Juliet is not dead, but Romeo thinks she is.

what is a collection of records DBMS?

Answers

Answer:Database

Explanation:

- is an integrated collection of logically related records or files. A database consolidates records previously stored in separate files into a common pool of data records that provides data for many applications. The data is managed by systems software called database management systems (DBMS).

Answer:

Database

Explanation:

Put the following events from computer history in the order they happened:

Answers

Show us a picture so we can answer



Horatio would like to use the category functionality contained within Outlook 2016. Which option should he choose to be able to rename categories?

Answers

Answer:

Items that are associated with one another as a group can be categorized by assigning colors to the group for easy identification in Microsoft Outlook

The different colors used includes; Yellow, Blue, Red, Green, Purple, and Orange

in order to rename a category choose the 'All Categories...' option among the options in the Categorize menu, to display the 'Color Categories' dialogue box

Within the 'Color Categories' dialogue box, check the box next to the desired color of the category and select rename

Type in the new name of the Color Category

With the check box next to the Color Category of the items that are currently selected and displayed in outlook, select 'OK' to assign the Color Category to the items

Explanation:

Write an extensive note on register and type of register .
a very long note that will give me enough mark.


I WILL MARK U BRAINLEST
30 POINTS

Answers

I don’t understand can you simplify

Which type of app is the best choice when it is critical to be able to use the device's features but performance is not critical?


hybrid
native
mobile
web

I will give brainlist

Answers

Answer: hybrid

Explanation: got it right on edge

The correct option is hybrid.

What is a  hybrid?Hybrid electric vehicles are powered by an inner combustion engine and one or more electric motors, which use energy stored in batteries. A hybrid electric vehicle cannot be packed in to charge the artillery. Instead, the battery is charged through regenerative braking and by the internal explosion engine.A hybrid is described as something that is a mixture of two different something. An example of a hybrid is a car that operates on gas and electricity. An illustration of a hybrid is a rose that is constructed from two different varieties of roses. noun.Because hybrid vehicles allow you to save on gas, you will regularly preserve fuel costs. However, there is further possible protection as well! Many conditions offer tax inducements to those who drive hybrid or electric vehicles, which will help you save supplemental money in the long run.

To learn more about Hybrid, refer to:

https://brainly.com/question/24337967

#SPJ2

PLEASE HELP

Write a method that takes two rectangles and returns the (positive) difference between their areas.
This method must be named areaDiff() and have 2 Rectangle parameters. This method must return a double.

For example suppose two Rectangle objects were initialized as shown:

Rectangle rect1 = new Rectangle(2.0, 8.0);
Rectangle rect2 = new Rectangle(6.0, 3.0);
The method call areaDiff(rect1, rect2) should then return the value 2.0.

Answers

The program to define a method that computes the positive difference between the areas of two rectangles is found in the attached image.

The program defines a class Rectangle with a constructor, and a static method areaDiff. The static method areaDiff takes two rectangles (rect1 and rect2) and returns the positive difference between their areas.

The formula used by areaDiff is:

[tex]|(rect1.width \times rect1.height)-(rect2.width \times rect2.height)|[/tex]

where

[tex]rect1,rect2=\text{the two rectangles}\\(rect.width\times rect.height)\text{ calculates the area of a rectangle object}\\|x|=\text{the absolute value function}[/tex]

Another Python program that solves a geometry problem can be found here: https://brainly.com/question/19150697

The student's behavior is an example of what?
O a violation of intellectual property rights
an online invasion of privacy
inappropriate use of Internet sites
an incident of cyberbullying

Answers

Answer:

A

Explanation:

Answer:

A.) a violation of intellectual property rights

Explanation:

Live Preview, found in the Font group, uses which method for seeing different font sizes without committing to them.
double-clicking the sizes on the Size drop-down list
pointing the mouse pointer to the sizes on the Size drop-down list
right-clicking the cell and clicking Preview Size on the drop-down list
clicking the sizes on the Size drop-down list

Answers

Answer:

B- pointing the mouse pointer to the sizes on the Size drop-down list

Explanation:

Answer:

B

Explanation:

got it right on edge

How does segmenting your network increase network security?

Answers

Answer:

By segmenting networks, it becomes easier to protect the most sensitive data that you have on your internally-facing network assets. The creation of a layer of separation between servers containing sensitive data and everything outside of your network can do wonders to reduce your risk of data loss or theft.

Explanation:

PLEASE MARK ME AS BRAINLIEST

Jiwoo is a professional photographer. Identify and describe a photography scenario where Jiwoo would need to consider the ethics and aesthetics of photography before proceeding. Clearly examine what ethical and aesthetic consideration she would have based on the scenario that you describe and how these relate to photography as a career or art form in general.

Answers

Answer:

Photography ethics are the principles that guide the way we take and share photos. Why is photography ethic so important? If we don't have morality in the way we use photography, we risk Aesthetics Ethics deals with the rights and wrongs and Aesthetics deals with beauty or otherwise. When we correct, manipulate or enhance images, the factors of ethics and aesthetics must always be kept in consideration. Where Does One Draw The Line if you add or remove something there that wasn’t in the scene you have crossed from documentary to fictional art. Exceptions In other cases, the only way to present a truer representation of reality is through a composite rather than with a single exposure.

Explanation:

I hope this helps I little

You are the leader of your school's Go Green Club, which supports environmentally friendly choices and lifestyles. Your club will represent your school in the forthcoming annual Green City competition. The school coordinator has allocated a fixed budget and a timeline of 30 days to design an ID card format that closely represents the club's theme, and to send it back to him for approval.

To get the desired creative effect, the school coordinator advised you to use desktop publishing software to create the card design and to produce them later, in the required numbers. You'll create the ID cards for the members with desktop publishing software. In your answer, mention the software you’ll use and describe the steps you'll follow to create the ID cards.

(Hint: First identify the audience, timeframe, and limitations of the task, if any. Then, identify the hardware and software to create the ID cards. Lastly, create and finalize the formatting techniques and templates for the ID card.)

Answers

Answer:

(Answers may vary.)

My Considerations

The Go Green Club has a total of 100 members. I plan to photograph each of them in front of our club's "Go Green" sign. I have a deadline of 30 days to deliver the ID cards. Therefore, I have to ensure that all the cards are printed and ready for delivery in 20 days, with 10 days of buffer time (in case the cards require any edits or changes). Additionally, after I have submitted the draft for review, I will need the coordinator's final approval on the design and layout of the ID card.

Hardware Requirements

a desktop computer or laptop with adequate memory to run the software to create the ID cardssome external storage devices, such as pen drives and DVD disks, to share the design and layout for the coordinator to review; I will also need these devices to store the final digital file for printa color scanner to scan hand-drawn artwork and signatures, which I will place on the ID carda digital camera to capture photos of members, and to transfer them to the computer/laptopa printer to make hard copies of the cards.Software Requirements

I intend to use Scribus to create the ID cards because it is a free DTP application, and has most of the common features I'd need to create an ID card.

Formatting Techniques

I plan to use the following techniques to design the club ID cards.I'll use the landscape or horizontal orientation. This will enable proper spacing for the ID card elements.I'm planning to use a card measuring 3.370 inches × 2.125 inches. A card this size will ensure that all the elements of the card are visible.I am planning to place the club logo on the top left corner, because the eye normally follows the path of the letter Z. This'll help the viewer to see the logo and identify/recognize the club.Next I'll place the club name; I'll use the top-center alignment and also vertically align it to the logo. I'll use the sans serif font for the club name.Following the Z-path rule, I'll place the member's photo to the right and the member's name under the photo. In this position, the photo and the name will be visible, and will not get mixed up with other elements. I'll print the member name with a serif font.Finally, again in line with the Z-path rule, I'll position the club seal and the club director's signature at the right lower bottom. Although these elements are essential on an ID card, they do not require as much viewer attention as the club logo, name, and member photo.

Explanation:

I used Canva for this card.

Other Questions
Is 4 5/12 a rational number PLEASE ANSWER ASAP FOR BRAINLEST!!!!!!!!!!!!!!!! EASY QUESTION!!!!!!!!!!!!!!!!!!!!You are going to write a personal reflection on the topic of bullying. Even though this topic may make you feel uncomfortable because it will require you to admit to your own poor choices, it is always great to be reflective of our actions.In this personal reflection, you are to write about a time when you were unkind to someone else. You will identify the things that you did or said and then write about why you chose those actions at the time.Then, you are to write about how your actions or words may have made the other person feel. Finally, at the end of the reflection, you are to write out a better plan of action for how you could have handled a similar situation in the future. Given the graph of the function F(x) below, what happens to F(x) when x is avery small positive number?A. FX) is a very small positive numberB. F(x) is a negative number with a large absolute valueC. F(x) is a very large positive numberD. F(x) is a negative number with a small absolute value Find the next three terms of the following arithmetic sequencePlease help Did Roy Benavidez actions go beyond what a solider is expected to do? Explain Can someone please help me with this? which comparison does the ratio 20:21 represent? Did Alexander the Great discovered sugar cane in India through Nearchus the captain? Choose the correct word.Which word is not mixed up with the others when trying to say "when" in German?O alsO wennobwann HELP PLEASE! and give out good answers.The histogram below represents the weights, rounded to the nearest pound, of several orders of dog food. Which statement best describes the weights of the orders represented in the histogram? 1. There is a peak in the orders from 6 to 10 pounds 2. The orders are symmetrical about 8 pounds. 3. The orders cluster near 20 pounds. 4. There is a gap in the orders from 11 to 15 pounds What did Kathy O'Brien did in the story monster? How did the US Constitution differ from the Articles of Confederation?A. It removed all authority from state governments.B. It provided a frame of government for the new nation.C. It granted a number of powers to the federal government.D. It gave states powers that conflicted with national interest Which of the following statements is true of an essays conclusion?It includes the first statement of your thesis.It provides new evidence to support your argument.It hooks your reader.It creates a sense of completeness. please helpppppppppppppppppppppppppppppppppppppppppA student added some sugar to a glass of water, but it did not dissolve quickly. What could the student do to increase the rate at which the sugar dissolves in the water? *Freeze the waterHeat the waterFilter the waterAdd salt to the water Rewrite 48+40 using the distributive property with the greatest common factor located in front of the parentheses Complete this number sentence with the correct symbol.0.2 ___ 0.20A) C) =help me PLZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ Noticing the color of other people's skin is done by:O A. American Indians.B. white Americans.O C. Asian Americans.O D. all of the above. Father was returning Gabe to the Nurturing Center permane21 pointWhile on the run, how did Jonas hide from the search planes?O By passing memories of war on to GabeBy recalling memories of snow and coldBy transmitting memories of warmthOOBy remembering the memories of sailboats What other substance (besides salt) could you sprinkle over ice to affect how fast it melts? Describe how you would test the substance's impact on the melting time of ice. Predict the results of such a test. What advancements have India brought to other cultures?