I've googled a lot but can't seem to find anything about this problem, or maybe since I'm a noob I'm not searching the correct keywords. I did find one question but it was using an f-string inside a lambda function which is the exact opposite of what I need.
So I have a counter flag called tc which checks if the sum of two numbers exceeds a certain predefined constant. The counter flag works fine and gets 1 or 0 correctly. The thing I can't do is the next part of the program.
I want to directly check the condition and return it in an f-string.
Till now I've been able to make this.
timE = f"({(lambda x: x = 'next' if tc==1 else x = 'same')} day)"
print(timE)
What I get is
File "<fstring>", line 1
((lambda x: x = 'next' if tc==1 else x = 'same'))
^
SyntaxError: invalid syntax
What I need is if tc is 1 then the lambda function should return next else same.
And then the final result I need is either (next day) or (same day).
I did try some other thing which does not give me an error but is giving me something else.
timE = f"({(lambda : 'next' if tc==1 else 'same')} day)"
The output I'm getting here is
03:08 AM, (<function add_time.<locals>.<lambda> at 0x7fe5b4660dc0> day)
I know what I'm trying to do is somehow in someway possible in some hacky way, but I can't seem to find it.
Any help is appreciated