Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions aria.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def wishMe():
hour=int(datetime.datetime.now().hour)
if hour>=0 and hour<=12:
speak("Good Morning!")
elif hour>=12 and hour<18:
speak("Good Afternoon!")
# elif hour>=12 and hour<18:
# speak("Good Afternoon!")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change creates a logic error. Now users between 12:00-17:59 will receive "Good Evening!" instead of "Good Afternoon!". If you want to keep three time periods, this code should not be commented out. If you want to simplify to two periods, the condition should be if hour < 12 and the message should reflect "afternoon/evening" combined.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This creates a logic bug. By commenting out the afternoon condition, any time >= 12 will fall through to the else block and say "Good Evening!" even during afternoon hours (12:00-17:59). This is incorrect behavior.

Fix: Either:

  1. Keep the original code with the afternoon condition uncommented
  2. Or adjust the hour ranges to handle all time periods correctly

Example fix:

elif hour >= 12 and hour < 18:
    speak("Good Afternoon!")
else:
    speak("Good Evening!")

else:
speak("Good Evening!")

Expand Down