示例#1
0
#! /usr/bin/env python3.4
#
from listmod import find_median
l1 = input("Enter the first list of numbers: ")
l2 = input("Enter the second list of numbers: ")
l1 = [int(x) for x in l1.split()]
l2 = [int(x) for x in l2.split()]
(median, sorted_list) = find_median(l1, l2)

print("First list:", l1)
print("Second list:", l2)
print("Merged List:", sorted_list)
print("Median:", median)
#! /usr/bin/env python3.4
from listmod import find_median


if __name__ == "__main__":
    list1 = input("Enter the first list of numbers: ")
    list2 = input("Enter the second list of numbers: ")

    list1 = [int(x) for x in list1.split()]
    list2 = [int(x) for x in list2.split()]

    print("First list: {0}".format(list1))
    print("Second list: {0}".format(list2))

    (Median, Sorted_List) = find_median(list1,list2)

    print("Merged list: {0}".format(Sorted_List))
    print("Median: {0}".format(Median))

    pass
示例#3
0
文件: lists.py 项目: sheel7/ECE364
# $Author: ee364a11 $
# $Date: 2015-03-07 16:56:10 -0500 (Sat, 07 Mar 2015) $
# $HeadURL: svn+ssh://ece364sv@ecegrid-thin1/home/ecegrid/a/ece364sv/svn/S15/students/ee364a11/Prelab08/lists.py $
# $Revision: 77594 $
from listmod import find_median

list1 = input("Enter the first list of numbers: ")
l1 = [int(val) for val in list1.split()]

list2 = input("Enter the second list of numbers: ")
l2 = [int(val) for val in list2.split()]

print("First list: {}".format(l1))
print("Second list: {}".format(l2))

med, merged_list = find_median(l1,l2)
print("Merged list: {}".format(merged_list))
print("Median: {}".format(med))



def main():
    pass

# ENTRY POINT
if __name__ == "__main__":
    main()



示例#4
0
文件: lists.py 项目: igalfsg/ECE364
import listmod


fvals = input('Enter the fist list of numbers: ')
svals = input('Enter the second list of numbers: ')
flist = fvals.split()
for i in range(len(flist)):
    flist[i] = int(flist[i])
slist = svals.split()
for i in range(len(slist)):
    slist[i] = int(slist[i])
print("First list: " ,flist)
print("Second list: " ,flist)


median, lis = listmod.find_median(slist, flist)


print ("Merged list: ", lis)
print ("Median: ", lis[median])
示例#5
0
文件: lists.py 项目: vmanja16/ECE364
#! /usr/bin/env python3.4
#
from listmod import find_median
l1 = input("Enter the first list of numbers: ")
l2 = input("Enter the second list of numbers: ")
l1 = [int(x) for x in l1.split()]
l2 = [int(x) for x in l2.split()]
(median, sorted_list) = find_median(l1,l2)

print("First list:", l1)
print("Second list:", l2)
print("Merged List:", sorted_list)
print("Median:", median)
示例#6
0
文件: lists.py 项目: tatparya/ECE364
i1 = input( "Enter the first list of numbers: " )
i2 = input( "Enter the second list of numbers: " )

#   Convert input to two lists
l1 = i1.split()
l2 = i2.split()

#   Convert to list of integers
for item in l1:
    list1.append( int(item) )

for item in l2:
    list2.append( int(item) )

#   Call for merge function
( Median, Sorted_List ) = listmod.find_median( list1, list2 )
medianFound = 1

#   Output statements
print( "First list: ", list1 )
print( "Second list: ", list2 )

if medianFound == 0:
    print( "Merged list: Not implemented" )
    print( "Median: Not Implemented" )

else:
    print( "Merged list: ", Sorted_List )
    print( "Median:", Median )

示例#7
0
文件: lists.py 项目: CrocKim/ECE364
#! /usr/bin/env python

import sys
import string
import listmod

f1=[]
f2=[]
med=0
sl=[]
temp=raw_input("Enter the first list of numbers:")
temp2=raw_input("Enter the second list of numbers:")

strip_t=temp.split()
strip_t2=temp2.split()

for i in strip_t:
    f1.append(i)

for i in strip_t2:
    f2.append(i)


(med, sl) = listmod.find_median(f1, f2)

print "First list:", f1
print "Second list:", f2
print "Merged list:", sl
print "Median:", sl[med]
示例#8
0
文件: lists.py 项目: igalfsg/ECE364
import listmod

fvals = input('Enter the fist list of numbers: ')
svals = input('Enter the second list of numbers: ')
flist = fvals.split()
for i in range(len(flist)):
    flist[i] = int(flist[i])
slist = svals.split()
for i in range(len(slist)):
    slist[i] = int(slist[i])
print("First list: ", flist)
print("Second list: ", flist)

median, lis = listmod.find_median(slist, flist)

print("Merged list: ", lis)
print("Median: ", lis[median])
示例#9
0
import listmod as l

if __name__ == "__main__":
  list_1 = input("Enter the first list of numbers: ")
  list_2 = input("Enter the second list of numbers: ")

  print("First list: [" + list_1 + "]")
  print("Second list: [" + list_2 + "]")

  list_1 = list(map(int, list_1.split(' ')))
  list_2 = list(map(int, list_2.split(' ')))

  (merged, median) = l.find_median(list_1, list_2)

  print("Merged list: " + str(merged))
  print("Median: " + str(median))
示例#10
0
文件: lists.py 项目: nickmolo/ECE364
#
#$Author: ee364c12 $
#$Date: 2012-02-19 22:18:11 -0500 (Sun, 19 Feb 2012) $
#$HeadURL: svn+ssh://ece364sv@ecegrid-lnx/home/ecegrid/a/ece364sv/svn/S12/students/ee364c12/Prelab07/lists.py $
#$Revision: 35493 $

import sys 
from listmod import find_median


print "First List: ",
list1 = sys.stdin.readline().strip().split()

print "Second List: ",
list2 = sys.stdin.readline().strip().split()

(median, sorted_list) = find_median(list1, list2)


print "Merged list: ", sorted_list
print "Median: ", median








sys.exit(0)