|
20 | 20 | .execute() |
21 | 21 | ) |
22 | 22 |
|
23 | | - print("Created offer request: %s" % (offer_request.id)) |
| 23 | + print(f"Created offer request: {offer_request.id}") |
24 | 24 |
|
25 | 25 | offers = client.offers.list(offer_request.id) |
26 | 26 | offers_list = list(enumerate(offers)) |
27 | 27 |
|
28 | | - print("Got %d offers" % len(offers_list)) |
| 28 | + print(f"Got {len(offers_list)} offers") |
29 | 29 |
|
30 | 30 | selected_offer = offers_list[0][1] |
31 | 31 |
|
32 | | - print("Selected offer %s to book" % (selected_offer.id)) |
| 32 | + print(f"Selected offer {selected_offer.id} to book") |
33 | 33 |
|
34 | 34 | priced_offer = client.offers.get(selected_offer.id) |
35 | 35 |
|
36 | 36 | print( |
37 | | - "The final price for offer %s is %s (%s)" |
38 | | - % (priced_offer.id, priced_offer.total_amount, priced_offer.total_currency) |
| 37 | + f"The final price for offer {priced_offer.id} is {priced_offer.total_amount} ({priced_offer.total_currency})" |
39 | 38 | ) |
40 | 39 |
|
41 | 40 | payments = [ |
|
66 | 65 | .execute() |
67 | 66 | ) |
68 | 67 |
|
69 | | - print( |
70 | | - "Created order %s with booking reference %s" |
71 | | - % (order.id, order.booking_reference) |
72 | | - ) |
| 68 | + print(f"Created order {order.id} with booking reference {order.booking_reference}") |
73 | 69 |
|
74 | 70 | order_change_request_slices = { |
75 | 71 | "add": [ |
|
99 | 95 | order_change_offers_list = list(enumerate(order_change_offers)) |
100 | 96 |
|
101 | 97 | print( |
102 | | - "Got %d options for changing the order; picking first option" |
103 | | - % (len(order_change_offers_list)) |
| 98 | + f"Got {len(order_change_offers_list)} options for changing the order; picking first option" |
104 | 99 | ) |
105 | 100 |
|
106 | 101 | order_change = client.order_changes.create(order_change_offers_list[0][1].id) |
107 | 102 |
|
108 | | - print("Created order change %s, confirming..." % order_change.id) |
| 103 | + print(f"Created order change {order_change.id}, confirming...") |
109 | 104 |
|
110 | 105 | payment = { |
111 | 106 | "amount": order_change.change_total_amount, |
|
116 | 111 | client.order_changes.confirm(order_change.id, payment) |
117 | 112 |
|
118 | 113 | print( |
119 | | - "Processed change to order %s costing %s (%s)" |
120 | | - % ( |
121 | | - order.id, |
122 | | - order_change.change_total_amount, |
123 | | - order_change.change_total_currency, |
124 | | - ) |
| 114 | + f"Processed change to order {order.id} costing {order_change.change_total_amount} ({order_change.change_total_currency})" |
125 | 115 | ) |
0 commit comments