Skip to content

Palindrome question use of lambda and key

Hey guys so I was working on this problem on the algoExpert platform, but I am struggling to understand what longest and currentLongest are really doing. Just from the beginning, I am not entirely sure what the currentLongest = [0, 1] is doing, is it just saying that it will have 2 values? Are odd and even re…

Using eval in the middle of a python statement

I want to use eval in the middle of the following python statement: but because it does not return any value (it works in an “in place” manner), I cannot actually use it there and instead I receive an error of TypeError: can only concatenate list (not “NoneType”) to list . Is there any…

Python openpyxl get date output format

i have an excel file that i cant change, where im getting some info with openpyxl, on this case i have a cell with this DATE format MM/DD/YYYY i need the output on python to be: %d/%m/%Y Ive tried this : I get this error : How can i make this work correctly? (im new in python and also on

seperate array from large array in numpy by column condition

check if values of a,b are 1 ,2 and c,d are 3,4 then print it what i am currently doing is but it prints all the rows where the 1st column is 1 Answer You can slice your array and then use row equality checks: BTW, it is always a good idea to make an example that can be reproduced