Contact
Privacy
Coding Development Art
  • Home
  • Latest
  • Oldest
  • Popular
  • Random
  • Home»
  • Categrories»
  • Programming Languages»
  • Python»

Write a function that returns seperate lists of positive and negative numbers from an input list - Python

Categories:
Python
Viewed: 3 - Published at: a few seconds ago

[ Write a function that returns seperate lists of positive and negative numbers from an input list ]

def seperate_pn(l):
    pos_list = []
    neg_list = []
    for _ in l:
        if _<0:
            neg_list.append(_)
        else:
            pos_list.append(_)
    return pos_list, neg_list

Related Posts:

Android Button Example
Android Button Example
Android
Write a function to find the area of sqaure
Write a function to find the area of sqaure
Python
C Program to Print India Map
C Program to Print India Map
C Programs
Guide to the Ternary Operator in JavaScript
Guide to the Ternary Operator in JavaScript
JavaScript
5 Best TV Series That Every Programmer Should Watch
5 Best TV Series That Every Programmer Should Watch
Programming
Object Oriented Design Principles in Java
Object Oriented Design Principles in Java
Java

You may also like:

Plotting errorbar plot in Python
Plotting errorbar plot in Python
Python
Sharing a Unit of Work among many Services in ASP.NET MVC 3
Sharing a Unit of Work among many Services in ASP.NET MVC 3
C#
Write a Python program to Read CSV Columns Into List
Write a Python program to Read CSV Columns Into List
Python
How to Read from a Text File, Character by Character in C++
How to Read from a Text File, Character by Character in C++
How can I add more than one not to a CSS selector?
How can I add more than one not to a CSS selector?
CSS
How to Create, Move, and Delete Files in Python
How to Create, Move, and Delete Files in Python
Python
Categories
  • Blog
    • Career
    • Computer
    • Downloads
    • Internet
    • Linux
    • News
    • Review
    • Security
    • Technology
  • Database
    • MySql
    • Oracle Database
    • SQL Server
    • SQLite
    • mongodb
  • Dev
    • Algorithm
    • Android
    • Batch File Programming
    • Books
    • Competitive Programming
    • Computer Networks
    • Data Structure
    • Design
    • Development
    • Flutter
    • Game
    • Git
    • Interview Questions
    • JDBC
    • Machine Learning
    • Mobile
    • Operating System
    • Programming
    • Projects
    • Sponsored
    • Webservice
    • iOS
  • Framework
    • .NET
    • Angular
    • Django
    • MVC
    • Nodejs
    • React
  • Programming Languages
    • ASP.NET
    • C Programs
    • C#
    • C++ Programs
    • CSS
    • HTML
    • JSP
    • Java
    • JavaScript
    • PHP
    • PL/SQL
    • Python
    • SQL
    • Swift
    • VB.NET
  • Tools
    • privacy-policy-generator
    • Mac Vendors
    • Ports Numbers
    • Wifi Routers Passwords

Site all the data, are collected from Internet, belongs to original author, please do not used for commercial purposes !

Coding Development Art
  https://www.codevelop.art
 
  contact@codevelop.art

Posts

  • Home
  • Latest
  • Oldest
  • Popular
  • Random

Follow Us

© 2018 codevelop.art - Coding Develop Art - programming and development tutorials blog - Learn all Program languages | codevelop.art.
All Rights Reserved.
  • Contact
  • Privacy
  • Terms of service
  • Copyright
  • Disclaimer