lambda x : '%x' % x
the function is decimal to hexadecimal,what the principle? I am python newbie,thanks in advance
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In string-format notation, ‘%x’ is a placedholder for hexadecimal output.
The function takes a value and returns it formatted as a hexadecimal string.
It’s not “decimal to hexadecimal”, but “return (whatever you’re given) as a string in hexadecimal notation”.
For example,