Nov-19-2018, 06:08 PM
I’m writing to ask if you could help me with a short Python example. Here’s a list of the list of strings:
Could you suggest how to implement this into a statement that would enable one to replace all values less than a certain value by None (32, 46 => None), and then subtract the rest of the lists by another value? Something like:
if number < 65: q = None
else q = number - 12
I tried implementing this statement but with no luck:
Thank you for your time!
my_string = [[89, 111, 117, 32], [104, 97, 118, 101, 32], [109, 97, 100, 101, 32], [109, 121, 32], [115, 111, 117, 108, 46]]
Could you suggest how to implement this into a statement that would enable one to replace all values less than a certain value by None (32, 46 => None), and then subtract the rest of the lists by another value? Something like:
if number < 65: q = None
else q = number - 12
I tried implementing this statement but with no luck:
for i in my_string: if i < 65: i == NoneI imagine it must have to do to something with the fact that I’m using a nested list of strings, which I need to preserve.
Thank you for your time!