Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # nasza definicja w której musimy napisać kod
- def update(table, id_):
- """
- Updates specified record in the table. Ask users for new data.
- Args:
- table (list): list in which record should be updated
- id_ (str): id of a record to update
- Returns:
- list: table with updated record
- """
- user_input = []
- record_to_update = []
- index_of_record_to_update = 0
- for index, record in enumerate(table):
- if record[0] == id_:
- record_to_update = record
- index_of_record_to_update = index
- #tutaj musicie zrobic zapytanie do uzytkownika co chce zmienic ze np
- # change year enter:0
- # change costam enter:1
- # nie wiem jaka jest funckja w pythonie musicie sprawdzic
- # nastepnie kolejne pytanie na co chce zmienic
- # i teraz znacie record i wiecie co zmienic to
- # np.
- new_year = "1999"
- record_to_update[5] = new_year
- table[index_of_record_to_update] = record_to_update
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement