Python Forum
How to convert value to defined number?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to convert value to defined number?
#4
Always post your code.
You're going to have to convert each member of your split list to lowercase before looking up in the dictionary:
>>> mystr = "Time is never lost - it's just replaced"
>>> mylist = mystr.split()
>>> mylist[3].lower()
'lost'
>>>
Reply


Messages In This Thread
RE: How to convert value to defined number? - by Larz60+ - Dec-08-2019, 12:03 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  convert % to a number Nickd12 2 2,096 Sep-18-2020, 12:18 AM
Last Post: deanhystad
  python library not defined in user defined function johnEmScott 2 3,917 May-30-2020, 04:14 AM
Last Post: DT2000
  Find Average of User Input Defined number of Scores DustinKlent 1 4,372 Oct-25-2019, 12:40 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