Skip to content

Commit c481937

Browse files
committed
actually updating to use f-strings
it would be helpful if i actually updated the examples to use f-strings 😅
1 parent 08ff000 commit c481937

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

examples/seesaw_ano_rotary_7segment_demo.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,16 @@
5252

5353
if position != last_position:
5454
last_position = position
55-
display.print(" {}".format(position))
56-
print("Position: {}".format(position))
55+
display.print(f" {position}")
56+
print(f"Position: {position}")
57+
5758
for b in range(5):
5859
if not buttons[b].value and button_states[b] is False:
5960
button_states[b] = True
6061
display.print(seven_segment_names[b])
61-
print("{} button pressed".format(button_names[b]))
62+
print(f"{button_names[b]} button pressed")
6263

6364
if buttons[b].value and button_states[b] is True:
6465
button_states[b] = False
6566
display.print(" ")
66-
print("{} button released".format(button_names[b]))
67+
print(f"{button_names[b]} button released")

examples/seesaw_ano_rotary_simpletest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@
4949

5050
if position != last_position:
5151
last_position = position
52-
print("Position: {}".format(position))
52+
print(f"Position: {position}")
5353

5454
for b in range(5):
5555
if not buttons[b].value and button_states[b] is False:
5656
button_states[b] = True
57-
print("{} button pressed".format(button_names[b]))
57+
print(f"{button_names[b]} button pressed")
5858

5959
if buttons[b].value and button_states[b] is True:
6060
button_states[b] = False
61-
print("{} button released".format(button_names[b]))
61+
print(f"{button_names[b]} button released")

0 commit comments

Comments
 (0)