forked from rogerwcpt/python-linq-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinq-miscellaneous.py
48 lines (29 loc) · 962 Bytes
/
linq-miscellaneous.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import shared
def linq94():
numbers_a = [0, 2, 4, 5, 6, 8, 9]
numbers_b = [1, 3, 5, 7, 8]
all_numbers = numbers_a + numbers_b
print("All numbers from both arrays:")
shared.printN(all_numbers)
def linq95():
products = shared.getProductList()
customers = shared.getCustomerList()
customer_names = [p.ProductName for p in products]
product_names = [c.CompanyName for c in customers]
all_names = customer_names + product_names
print("Customer and product names:")
shared.printS(all_names)
def linq96():
words_a = ["cherry", "apple", "blueberry"]
words_b = ["cherry", "apple", "blueberry"]
match = words_a == words_b
print("The sequences match: %s" % match)
def linq97():
words_a = ["cherry", "apple", "blueberry"]
words_b = ["apple", "blueberry", "cherry"]
match = words_a == words_b
print("The sequences match: %s" % match)
linq94()
# linq95()
# linq96()
# linq97()