Skip to content
This repository was archived by the owner on Apr 24, 2025. It is now read-only.

Commit 650f1aa

Browse files
committed
Fix code style issues with Black
1 parent 1fd285e commit 650f1aa

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

projects/Alarm Clock/clock.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
top.title("Dynamic Clock") # Updated title
77
top.resizable(0, 0) # Making the window non-resizable
88

9+
910
# Function to determine the time of day
1011
def get_time_of_day(hour):
1112
if 5 <= hour < 12:
@@ -15,6 +16,7 @@ def get_time_of_day(hour):
1516
else:
1617
return "Evening"
1718

19+
1820
# Function to update the time display
1921
def update_time():
2022
current_time = strftime("%H:%M:%S %p")
@@ -25,12 +27,17 @@ def update_time():
2527
clock_time.config(text=current_time + f"\nGood {time_of_day}!")
2628

2729
# Dynamically change the background color based on time of day
28-
color = "lightblue" if time_of_day == "Morning" else "lightyellow" if time_of_day == "Afternoon" else "lightcoral"
30+
color = (
31+
"lightblue"
32+
if time_of_day == "Morning"
33+
else "lightyellow" if time_of_day == "Afternoon" else "lightcoral"
34+
)
2935
top.configure(background=color)
3036

3137
# Schedule the update_time function to be called again after 1000 milliseconds (1 second)
3238
clock_time.after(1000, update_time)
3339

40+
3441
# Creating a Label widget to display the time
3542
clock_time = tkinter.Label(
3643
top,

projects/Tile Matching/tile_matching.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import random
33
from tkinter import messagebox
44

5+
56
class TileMatchingGame:
67
def __init__(self, root, rows, columns):
78
self.root = root
@@ -125,6 +126,7 @@ def reset_game(self):
125126
self.root.destroy()
126127
main()
127128

129+
128130
def main():
129131
root = tk.Tk()
130132
root.title("Tile Matching Game")
@@ -143,5 +145,6 @@ def main():
143145

144146
root.mainloop()
145147

148+
146149
if __name__ == "__main__":
147150
main()

0 commit comments

Comments
 (0)