Skip to content

Tag: python

Hacker rank List Prepare

This is my Code and it gives me this error message. Why? Error Message – Traceback (most recent call last): File “/tmp/submission/20220617/03/45/hackerrank-3495035b4042c8bc0c55e799a2d2e687/code/Solution.py”, line 15, in l.sort() TypeError: ‘<‘ not supported between instances o…

Python concatenate (multiple) strings to number

I have a python list [‘a1’, ‘b1’, ‘a2’, ‘b2′,’a3’, ‘b3’]. Set m=3 and I want get this list using loops, because here m=3 could be a larger number such as m=100. Since we can have then I try to get [‘a1’, ‘b1’, &#82…

Load data from Flask/Python to HTML textarea

I am trying to send data from Python / Flask to an HTML form textarea but need some help. responses.html is shown below. A portion of app.py is shown below: I would like to display any previously recorded responses in the response textarea of responses.html while preserving the placeholder when no previous re…

sorting .csv file using pandas

I am using pandas.DataFrame.sort_values to sort my csv. My csv without sorting looks like . I am trying to sort my csv file by numbers in ATOM_id in ascending order. This is my code snippet df.sort_values([“ATOMS_ID”],axis = 0, ascending = [True],inplace = True). This is what I . I am not really s…