Python Forum
Issue with logic in homework
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Issue with logic in homework
#2
You should change single character names to meaningful ones
...
hint -- you can ask:
try:
    idx = s.index('bad')
    idx1 = s.index('good')
    if idx < idx1:
       ...
except:
    return s
assuming you can use try/except, you fill in ...
Reply


Messages In This Thread
Issue with logic in homework - by fad3r - May-24-2018, 12:41 AM
RE: Issue with logic in homework - by Larz60+ - May-24-2018, 12:50 AM
RE: Issue with logic in homework - by fad3r - May-24-2018, 12:57 AM
RE: Issue with logic in homework - by Larz60+ - May-24-2018, 02:12 AM
RE: Issue with logic in homework - by fad3r - May-24-2018, 02:42 AM
RE: Issue with logic in homework - by Larz60+ - May-24-2018, 08:13 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Homework, works but has logic error goldielocks789 3 1,239 Apr-24-2023, 11:52 AM
Last Post: Larz60+
  saving issue on homework assignment russoj5 2 1,990 Oct-26-2020, 01:53 PM
Last Post: russoj5
  Homework (counting iteration issue) Cardinal07 10 5,722 Feb-26-2018, 04:45 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020