Skip to content
Advertisement

Tag: python-3.x

Getting indices of ascending order of list

I know that this question has been asked a hundred times, but the answer always seems to be “use numpy’s argsort”. But either I am misinterpreting what most people are asking, or the answers are not correct for the question. Whatever be the case, I wish to get indices of a list’s ascending order. The phrasing is confusing, so as

Python Challenge level 3 – Solving with string slicing

apologies to posting the question, as has been answered in other questions as well. However, couldn’t figure out what’s wrong with this solution. The question requires to find the lower-cased characters bordered by 3 upper-cased characters on each side. The code i’ve writting: The string i’m getting is ‘lgvcaaginbkvsoezhtlnldslyitlooqfgiksudtm’ vs ‘linkedlist’ Thanks for the help. Edit: for some reason the

Web scraping: Index out of Bound (Possible scaling error)

Hi Wrote a web scraping program and it gets the ASN number correctly, but after all the data is scraped, it returns a error “Array Out if Bounds”. I am using Pycharm and latest python version. Below is my code. There is already a similar issue on stackoverflow but I am not able to get the pieces together and make

Starred expression in ternary operator python

I wrote a python program to print the ascii value of up to every 3 numbers in a string or “ERROR” if the length is not divisible by three. I was golf the code when I ran into a SyntaxError. Code: But this works: Putting a space before the * or after the 3 doesn’t work. I could just use

Advertisement