-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsales.py
More file actions
57 lines (42 loc) · 1.12 KB
/
Copy pathsales.py
File metadata and controls
57 lines (42 loc) · 1.12 KB
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
49
50
51
52
53
54
55
56
57
# python program which enter sales per day for a week and display total sales for the week
'''sales = []
for day in range(1,8):
dailysales=float(input("Enter sales for day {}: ".format(day)))
sales.append(dailysales)
print(sales)
total=0
for sale in sales:
total+=sale
print("Total sales for the week is: ", total)'''
'''def dailySales(dailysales):
sales = []
for day in range(1,8):
sales.append(dailysales)
return sales
def totalSales(sales):
total = 0
for sale in sales:
total += sale
return total
def main():
sales = dailySales(100)
print(sales)
total = totalSales(sales)
print("Total sales for the week is: ", total)
main()
'''
import random
number = random.randint(0,9)
lottery=[]
for i in range(7):
lottery.append(random.randint(0,9))
for i in range(7):
print(lottery[i], end=" ")
pangram = "The quick brown fox jumps over the lazy dog"
words=['kiswahili','english','arabic']
def find_longest_word():
longest_word = ""
for word in words:
if len(word)>len(longest_word):
longest_word = word
return longest_word