Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

program to split the list between even and odd python

# Python code to split into even and odd lists
l=[]
n=int(input("enter the  length of the list:"))
for i in range(1,n+1):
    a=int(input("enter element"))
    l.append(a)
print(l)
even=[]
odd=[]
for j in l:
    if j%2==0:
        even.append(j)
    else:
        odd.append(j)
print("even number ",even)
print("odd  number", odd)
Comment

PREVIOUS NEXT
Code Example
Python :: python counter get most common 
Python :: redis get all keys and values python 
Python :: import py to exe 
Python :: skewness python 
Python :: one matrix with np 
Python :: python diamond pattern 
Python :: how to save to file in python 
Python :: python date now plus days 
Python :: how to type a dict in python 
Python :: write csv python pandas stack overflow 
Python :: put array over array in numpy 
Python :: python remove non empty read only directory 
Python :: pandas select column by index 
Python :: df select first n rows 
Python :: factors addition in pyhone 
Python :: python accept user input 
Python :: cv2 waitkey 
Python :: python 3 of 4 conditions true 
Python :: how to get sum specific columns value in machine learning 
Python :: python env variable 
Python :: delay time python 
Python :: python argparse 
Python :: dataframe catch data types 
Python :: python turtle window not responding 
Python :: pandas read csv unamed:o 
Python :: how to launch jupyter notebook from cmd 
Python :: python program to find fibonacci series using function recursion loop 
Python :: where to find python3 interpreter 
Python :: count the frequency of words in a file 
Python :: spike python 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =