Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
if else condition issue
#5
Try to use what @buran suggested, his script is more efficient than mine.
About the "wire", there is no "wire" in file1.txt, so the condition will not be satisfied.
Are you testing with different file1.txt?

PS: When using open() you have to pass a string as the file name, in your code you need to change it to open('file1.txt', "r").
Reply


Messages In This Thread
if else condition issue - by mmaz67 - Jul-17-2018, 08:51 AM
RE: if else condition issue - by gontajones - Jul-17-2018, 10:05 AM
RE: if else condition issue - by buran - Jul-17-2018, 10:52 AM
RE: if else condition issue - by mmaz67 - Jul-18-2018, 05:38 AM
RE: if else condition issue - by gontajones - Jul-18-2018, 09:02 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Issue with program not passing to other elif condition Abdirahman 6 2,272 Nov-21-2021, 07:04 AM
Last Post: Abdirahman
  else condition not called when if condition is false Sandz1286 10 6,140 Jun-05-2020, 05:01 PM
Last Post: ebolisa
  [HELP] Nested conditional? double condition followed by another condition. penahuse 25 8,505 Jun-01-2020, 06:00 PM
Last Post: penahuse

Forum Jump:

User Panel Messages

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