Python Forum
This is weird!!! It should work but I get an but I get a "ValueError: I/O operation"
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
This is weird!!! It should work but I get an but I get a "ValueError: I/O operation"
#3
(Mar-24-2021, 02:25 AM)BashBedlam Wrote: def has_33(nums):    length = len (nums) - 1    for i in range (length):        if nums [i] == 3 and nums [i+1] == 3:            return True    return False print (has_33([1, 3, 1, 3]))print (has_33([3, 1, 3]))print (has_33([1, 3, 3]))
Ok! It's working now. Thank you! I replaced the "quit()" with "returns" as you suggested and it appears to work, both with the code I had written and what you had written.
Reply


Messages In This Thread
RE: This is weird!!! It should work but I get an but I get a "ValueError: I/O operation" - by ashergreen - Mar-24-2021, 11:47 PM

Forum Jump:

User Panel Messages

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