-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathseat.py
43 lines (36 loc) · 1.11 KB
/
seat.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
import database
class seat():
def hall_setup(self,row,coloumn):
self.row = row
self.coloumn = coloumn
print('\nCinema: ')
# print('The sitting capacity of hall is: ', self.row*self.coloumn, '\n')
def show_seat(self,row,coloumn):
for x in range(0, self.row + 1):
if x == 0:
row_string = ' ' + ' '
else:
row_string = str(x) + ' '
for y in range(1,self.coloumn + 1):
if x == 0:
row_string = row_string + str(y) + ' '
else:
row_string = row_string + 'S' + ' '
print(row_string)
def booked_seat(self):
for x in range(0, database.hall_row + 1):
if x == 0:
row_string = ' ' + ' '
else:
row_string = str(x) + ' '
for y in range(1,database.hall_coloumn + 1):
if x == 0:
row_string = row_string + str(y) + ' '
elif x in database.booked_ticket_x_list:
if y in database.booked_ticket_y_list:
row_string = row_string + 'B' + ' '
else:
row_string = row_string + 'S' + ' '
else:
row_string = row_string + 'S' + ' '
print(row_string)