Python Forum
So simple yet not working....
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
So simple yet not working....
#9
(Oct-26-2020, 11:10 PM)bowlofred Wrote: In your changed version, on line 5: temperature.replace() doesn't modify temperature. It returns the modified string. If you don't assign it to something (like temperature), the replacement is lost.

temperature.replace("F", "") # this is a noop because the replaced string is not captured anywhere

BINGO! Now it works.
So now I understand that I can't just add the .replace to a str and it will replace the character. I have to assign it to the variable.

Thanks a million bowlofred!!
Reply


Messages In This Thread
So simple yet not working.... - by giladal - Oct-26-2020, 10:19 PM
RE: So simple yet not working.... - by Askic - Oct-26-2020, 10:37 PM
RE: So simple yet not working.... - by giladal - Oct-26-2020, 10:41 PM
RE: So simple yet not working.... - by Askic - Oct-26-2020, 10:44 PM
RE: So simple yet not working.... - by giladal - Oct-26-2020, 10:53 PM
RE: So simple yet not working.... - by bowlofred - Oct-26-2020, 10:39 PM
RE: So simple yet not working.... - by giladal - Oct-26-2020, 10:49 PM
RE: So simple yet not working.... - by bowlofred - Oct-26-2020, 11:10 PM
RE: So simple yet not working.... - by giladal - Oct-27-2020, 07:05 AM
RE: So simple yet not working.... - by jps2020 - Oct-27-2020, 12:13 PM
RE: So simple yet not working.... - by Askic - Oct-27-2020, 04:59 PM
RE: So simple yet not working.... - by jefsummers - Oct-27-2020, 02:28 PM
RE: So simple yet not working.... - by deanhystad - Oct-27-2020, 09:23 PM
RE: So simple yet not working.... - by GOTO10 - Oct-27-2020, 09:31 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Simple conditional not working as expected return2sender 8 1,155 Aug-27-2023, 10:39 PM
Last Post: return2sender
  Why isn't this working. I've made it as simple as posible gcryall_Forum 3 2,538 Mar-10-2019, 03:07 PM
Last Post: gcryall_Forum

Forum Jump:

User Panel Messages

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