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
Bogdan [553]
3 years ago
8

How to remove duplicates from list in python?

Computers and Technology
2 answers:
kondaur [170]3 years ago
5 0
<span> the new way of </span>removing duplicates<span> from an iterable while keeping it in the original order </span>
SVEN [57.7K]3 years ago
5 0

Sets automatically remove duplicates. You can convert it into a set, convert it back into a list, and run sorted() on the list, or your own sorting algorithm.

You might be interested in
There are ______ type of accounts
NemiM [27]

Answer:

Option 3,

A.KA Three

Explanation:

5 0
3 years ago
Read 2 more answers
[20 pts] Write the function rectangle(perimeter, area), which takes two positive integers, perimeter and area. It returns an int
MrRissso [65]

Hi, you haven't provided the programing language in which you need the code, I'll explain how to do it using Python, and you can follow the same logic to make a program in the programing language that you need.

Answer:

import math

def rectangle(perimeter, area):

   l1_1 = (perimeter+math.sqrt((perimeter**2)-(16*area)))/4

   l1_2 = (perimeter-math.sqrt((perimeter**2)-(16*area)))/4

   l2_1 = area/l1_1

   l2_2 = area/l1_2

   print(l1_1,l2_1)

   print(l1_2,l2_2)

   if l1_1.is_integer() and l2_1.is_integer() and l1_1>0 and l2_1>0:

       return(int(max(l1_1,l2_1)))

   elif l1_2.is_integer() and l2_2.is_integer() and l1_2>0 and l2_2>0:

       return(int(max(l1_2,l2_2)))

   else:

       return(None)

Explanation:

  • We import math to make basic operations
  • We define the rectangle function that receives perimeter and area
  • We calculate one of the sides (l1_1) of the rectangle using the quadratic equation to solve 2h^2 - ph + 2a = 0
  • We calculate the second root of the quadratic equation for the same side (l1_2)
  • We calculate the second side of the rectangle using the first root on w = a/h
  • We calculate the second side of the rectangle using the second root on w= a/h
  • We verify that each component of the first result (l1_1, l2_1) is an integer (using the build-in method .is_integer) and greater than 0, if True we return the maximum value between them (using the max function) as w
  • If the first pair of sides evaluate to False we check the second root of the equation and if they meet the specification we return the max value
  • if all the if statements evaluate to false we return None to indicate that not positive or integer sides were found

7 0
3 years ago
In the Northern Hemisphere, large south-facing windows receive more total sunlight during the day and would be a part of a ___ s
9966 [12]

Answer:

Passive solar heating system

Explanation:

The goal of passive solar heating systems usually refers to the system in which the energy provided by the sun is used for heating and cooling of the living places in a house.

When sunlight falls on the house, the building elements capture the heat energy of the sun and it later releases back this heat when the sun is not there. The main objective of this system is to regulate the room temperature. It is comprised of two main elements, one is the glasses that face towards the south and a thermal mass that is used for heat absorption, storing and distribution of heat.

6 0
3 years ago
Suppose you are provided with 2 strings to your program. Your task is to join the strings together so you get a single string wi
Mariulka [41]

Answer:

public class TestImport{

   public static void main(String[] args) {

       String string1 = args[1];

       String string2 = args[2];

       System.out.println(string1 +" " +string2);

   }

}

Explanation:

The solution here is to use string concatenation as has been used in this statement System.out.println(string1 +" " +string2);

When this code is run from the command line and passed atleast three command line arguments for index 0,1,2 respectively, the print statment will return the second string (that is index1) and the third argument(that is index2) with a space in-between the two string.

6 0
3 years ago
Once you turn 18, if you choose one of the 4 options for accessing credit, how will you be sure you use that credit responsibly?
dmitriy555 [2]

Answer:

hm not sure man

Explanation:

sorry, give me crown and 5 stars  tho

6 0
3 years ago
Other questions:
  • Please draw a diagram of a complete graph with 5 vertices (K5), its adjacency matrix and adjacency list representations.
    13·1 answer
  • What are the three fundamental elements of an effective security program for information systems?
    11·2 answers
  • Compare GBN, SR, and TCP (no delayed ACK). Assume that the timeout values for all three protocols are sufficiently long such tha
    7·1 answer
  • Write a program in Python that reads in investment amount, annual interest rate, and number of years, and displays the future in
    6·1 answer
  • Which of the following is the best definition of a workplace policy?
    13·1 answer
  • Use the modulo operator (%) to get the desired rightmost digits. Ex: The rightmost 2 digits of 572 is gotten by 572 % 100, which
    8·1 answer
  • Write a program that performs the following tasks: Display a friendly greeting to the user Prompt the user for the value to conv
    13·1 answer
  • The =COUNT function calculates what value?
    15·2 answers
  • Is it a way to get robuc 4 free
    6·2 answers
  • What are the advantages of using a vpn?​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!