Exemple #1
0
#!/usr/local/bin/python3.4

__author__ = 'ee364e10'
# import lists
from lists import find_median

if __name__ == "__main__":
    merge_flag = 0
    median_flag = 0
    median = 0

    l_1 = input("Enter the first list of numbers: ")
    l1 = l_1.split()

    l_2 = input("Enter the second list of numbers: ")
    l2 = l_2.split()

    numl1 = []
    for i in l1:
        numl1.append(int(i))

    numl2 = []
    for j in l2:
        numl2.append(int(j))

    tup_out = find_median(numl1 , numl2)
Exemple #2
0
#! /usr/bin/env python3.4
#from lists import *
from lists import find_median
__author__ = "Xihui Wang"

c, d = find_median([1, 3, 1], [1, 4, 1])
#print(c)
#print(d)
Exemple #3
0
#! /usr/bin/env python3.4
from lists import find_median

if __name__ == '__main__':
    first_list=input("Enter the first list of numbers: ").split()
    second_list=input("Enter the second list of numbers: ").split()
    first_list=list(map(int,first_list))
    second_list=list(map(int,second_list))
    value=find_median(first_list,second_list)
    print("First list: {}".format(first_list))
    print("Second list: {}".format(second_list))
    print("Merged list:{}".format(value[1]))
    print("Median: {}".format(value[0]))
Exemple #4
0
#! /usr/bin/env python2.6

from lists import find_median
import sys

print "Enter the first list of numbers: ",
data1 = sys.stdin.readline()
print "Enter the second list of numbers: ",
data2 = sys.stdin.readline()
data1 = data1.split()
data1 = map(int, data1)
data2 = data2.split()
data2 = map(int, data2)
(Median, Sorted_List) = find_median(data1, data2)
print "First list:",data1
print "Second list:",data2
print "Merged list:",Sorted_List
print "Median:",Median

sys.exit(0)
Exemple #5
0
from lists import find_median

first = input('Enter the first list of numbers:')
second = input('Enter the second list of numbers:')
firlist = list(map(int, first.split()))
seclist = list(map(int, second.split()))
med, medlist = find_median(firlist, seclist)
print('First list:', firlist)
print('Second list:', seclist)
print('Merged list:', medlist)
print('Median:', med)
Exemple #6
0
from lists import find_median

first = input('Enter the first list of numbers:')
second = input('Enter the second list of numbers:')
firlist = list(map(int,first.split()))
seclist = list(map(int,second.split()))
med, medlist = find_median(firlist, seclist)
print('First list:',firlist)
print('Second list:', seclist)
print('Merged list:', medlist)
print('Median:', med)