-
Notifications
You must be signed in to change notification settings - Fork 0
/
Day9.py
144 lines (113 loc) · 3.14 KB
/
Day9.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
import os
# Dictonaries Basics
"""dic = {
"fruits": "Mango,Banana,Apple",
"Vegetables": "Potato,Carrot,Onion"
}
# print(dic["fruits"]= "hii") Gives error
dic["fruits"]= "Pineapple, Orange, Avagado" # change value of fruits
dic["Animals" ] = "Cow,Dog,Buffalo" # add new element to the dictonary
for key in dic:
print(key)
print(dic[key])"""
# Challenge no 1
"""students = {
"Harry" : 81,
"Garry" : 92,
"Perry" : 75,
"Sharry": 62,
"Merry" : 89
}
students_grade = {
}
for key in students:
if students[key] >=90:
students_grade[key] = "Outstanding"
elif students[key] >=80:
students_grade[key] = "Good"
elif students[key] >=70:
students_grade[key] = "Acceptable"
elif students[key] <70:
students_grade[key] = "Fail"
for key in students_grade:
print(f"{key} : {students_grade[key]}")"""
# Nested list and dictonaries
# Nesting dictionies and list in a dictonary
'''food = {
"chiness": ["Noodles", "Manchurian"],
"Fast Food": {
"Burger": ["Ham Burger", "VadaPav", "Aloo Tikki Burger"],
"Pizza": ["Onian Pizza", "Panner Pizza"],
},
}
'''
# Nesting dictonaries in a list
'''food = [
{
"Food_Type": "FastFood",
"Burger": ["Ham Burger", "VadaPav", "Aloo Tikki Burger"],
"Pizza": ["Onian Pizza", "Panner Pizza"],
},
{
"Count": "How many times you eated that food",
"Burger_eated": 20,
"Pizza_eated": 15,
},
]
print(food[0]["Food_Type"])
'''
# Challenge no 2
'''travel = [{
"country" : "India",
"visited" : 20,
"Places" : ['Mumbai', "Delhi", "Hydrabad"]
},{
"country" : "USA",
"visited" : 3,
"Places" : ['New York', "San Fransisco", "Washington DC"]
}]
def add(country, visits, Places):
add_country = {"country": country, "visited": visits, "Places": Places}
travel.append(add_country)
add("Russia", 13, ["Mountains", "Mosscow"])
print(travel)'''
# Blind Bid Programme
print('''
___________
\ /
)_______(
|"""""""|_.-._,.---------.,_.-._
| | | | | | ''-.
| |_| |_ _| |_..-'
|_______| '-' `'---------'` '-'
)"""""""(
|_________|
`'-------'`
.-------------.
|_______________|
''')
print("Welcome to Blind Bid")
details = {}
end = True
while end:
name = input("Enter your name ")
amount = int(input("Enter the Bid Amount $"))
details[name] = amount
more_bid = input("Anyone here to add the bid? Type Y for Yes | N for NO-> ")
os.system('cls')
if more_bid == "Y":
continue
elif more_bid == "N":
end = False
else:
print("Wrong Input!")
end = False
max_name = ""
max_bid = 0
for key in details:
if details[key] > max_bid:
max_bid = details[key]
max_name = key
else:
continue
print(f"Highest Bid is done by {max_name} which is ${max_bid}")