Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

program to segregate positive and negative numbers in same list

#program to segregate positive and negative numbers in same list
a=eval(input('Enter a list :'))
a.sort(reverse=True)
print(a)
+-+-+-+-+-+-+-+-+-+-+--+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#output:
Enter a list :[1,-2,3,4,-5,6,-7,8,-9]
[8, 6, 4, 3, 1, -2, -5, -7, -9]
Comment

PREVIOUS NEXT
Code Example
Python :: python sympy solve equation equal to 0 
Python :: python get words between two words 
Python :: how to make a pairs plot with pandas 
Python :: install decouple python 
Python :: Finding the sum of even Fibonacci numbers less than or equal to given limit 
Python :: double .get().get() dict python 
Python :: python popen no message 
Python :: dropdown menu for qheaderview python 
Python :: how to remove trackback on python when ctrl c 
Python :: pyqt5 window size 
Python :: sort list of files by name python 
Python :: Python USD to Euro Converter 
Python :: python test if number in string 
Python :: Python program that takes 2 words as input from the user and prints out a list containing the letters that the 2 words have in common 
Python :: position in alphabet python 
Python :: browse list python 
Python :: pros and cons of python flush print function 
Python :: image to array keras 
Python :: how to move file from one location to another with python 
Python :: upload multiple files streamlit 
Python :: python how to obfuscate code 
Python :: rock paper scissors game in python 
Python :: get package share vs FindPackageShare 
Python :: how to know how much lines a file has using python 
Python :: pandas replace empty string with nan 
Python :: python hex to bytes string 
Python :: tbc full form in cricket 
Python :: yesno django 
Python :: python string to xml 
Python :: converting bool to 1 if it has true and if it is false print 1 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =