Posts by tatiane berrocal • 61 points
8 posts
-
0
votes2
answers489
viewsQ: Recursive algorithm to check if an element belongs to a list
I have to do a recursive function that takes a list and a target element, and returns True, whether the element is in the list; and False, otherwise. EXAMPLES: busca([1,2,3], 2) --> retorna True…
-
0
votes1
answer432
viewsQ: Queue - Python (order)
Let’s simulate a queue situation at the bus terminal. Write a function that receives a NAME LIST (strings) that indicates the order of arrival of people to catch a bus from the terminal. Your role…
-
1
votes2
answers376
viewsQ: python search
I need to create a binary search function. The function should look for the target in the list. checks if list[middle] is the number I want. If it is, it returns True. If it is not, and the middle…
-
1
votes3
answers629
viewsQ: Python: Indexerror: list index out of range
Does anyone know why you’re returning "list index out of range"? def balanceada(string): pilha = [] for i in string: if i != '(' or i != '[' or i != '{' or i != '<' or i != ')' or i != ']' or i…
pythonasked tatiane berrocal 61 -
0
votes1
answer259
viewsQ: Python - stack - - balancing
I can’t find the error in this code: A sequence of parentheses "(" ")", brackets "[" "]" and keys "{" "}" is said to be balanced if each "open" symbol is "closed" at an appropriate time For example…
-
-3
votes1
answer470
viewsQ: Python pile
I am unable to solve an exercise using python stack... A sequence of parentheses "(" ")", brackets "[" "]" and keys "{" "}" is said to be balanced if each "open" symbol is "closed" at an appropriate…
-
-2
votes2
answers143
viewsQ: Dictionary doubt
How do I count dictionary elements? datum: I need to implement a phone account function, which receives a phonebook and returns the amount of registered phone numbers. If there are repeat phones…
-
0
votes3
answers211
viewsQ: Compare the widget with the rest of the Python list
I need to create a program where in the given list, if the name is repeated it puts a numbering. For example: names = [maria, Joao, maria] the result should be result = [maria, Joao, maria1] Other…