-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcard.py
More file actions
22 lines (18 loc) · 579 Bytes
/
Copy pathcard.py
File metadata and controls
22 lines (18 loc) · 579 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
'''
Module containing needed data structures:
- class Card and some method for its management
- class CardsSet
'''
from typing import List
class Card:
def __init__(self, row_list: List[List], title: str) -> None:
self.content: List[List] = row_list
self.title: str = title
self.id: int = self.__get_number(self.title, 2)
self.set_id: int = self.__get_number(self.title, 1)
def __get_number(self, s: str, pos: int) -> int:
l = s.split()
if l[pos].isdigit():
return int(l[pos])
class CardsSet(list):
pass