I was analysing code as I had some free time and thought could learn something new! This was from a Binary to Denary converter code I found. But I have been bouncing it around in my head for almost the past 2-3 days now but I absolutely can't bring myself to what this statement/function/line does or means?
lambda b: str(int(b, 2))
I think the 'b' in (b, 2) means Binary?
I researched and found that lambda is a function to 'call in' Anonymous functions or functions that have no name. Is that correct?
What does 'b:' mean? Is that also Binary or maybe a 'sub name' within lambda?
Also what does
str(int(b, 2))
mean? I know thats the code that converts binary to denary but how does it exactly work?
I am very curious to find out! Hopefully someone will be able to help me get my head around this!