Posts by zangs • 233 points
7 posts
-
0
votes1
answer61
viewsQ: Convert a sqlalchemy query to a dictionary - Python
I have this consultation made with SQLalchemy ORM, where table_schema contains an example of sqlalchemy column nq = session.query(Base.table_schema).filter(Base.tablename == 'stores').scalar() The…
-
-1
votes1
answer603
viewsQ: Nameerror: name X' is not defined - Django Rest framework
Following the tutorial for creating API with DRF, I encountered difficulties while mapping the urls. By running 'python manage.py runserver', I get the following error path('', include(loja.urls)),…
-
-1
votes1
answer122
viewsQ: Highlighting words from a paragraph using Javascript only
As part of learning, I’m trying to underline words that are contained in a paragraph in a document html. By my logic, I would have to store this content in a variable and then scroll through it for…
-
12
votes3
answers5507
viewsQ: Count how many elements are duplicated in a string
The purpose is to account for the number of elements that are repeated in a string and not just check for duplicates or count how many times these elements appear. For example: "aabbca1m" // 2 (a,b)…
-
4
votes2
answers89
viewsQ: Change string characters, except the last 4
The idea of the function is to change the characters of a string (minus the last 4 characters) per "#". I created the function, but I believe I have problems in the logic of the code. function…
-
4
votes2
answers1240
viewsQ: Recursion to Python List Inversion
I’m trying to create a recursive function that reverses the order of a certain list. As a beginner, I believe I’m making mistakes during the construction of the function. def inverter(lista, size):…
-
1
votes2
answers3082
viewsQ: Python data entry with multiple lines
I would like to understand how to input several data (int, float, str...) per line but repeatedly (i.e., in several lines) so that I can save each given input. I understand that I will have to use a…