Posts by Matheus Campos • 56 points
3 posts
-
0
votes1
answer67
viewsA: replace in numpy array
You can use the replace even, but you must specify the element of the list, or go through it by changing the words: x = array(['mais uma vez, o Sr. Costner arrumou um filme por muito mais tempo do…
-
0
votes2
answers30
viewsA: Doubt called function by loop
Good afternoon Vinicius, if I understand correctly you want to calculate the value to be sold based on the cost of the product. Your code didn’t work because it didn’t put the essential parts inside…
pythonanswered Matheus Campos 56 -
4
votes3
answers155
viewsA: How do I remove the last "," that appears in the print?
you can do the following: for idx, i in enumerate(z): n = 2**i if idx == len(z)-1: print(n) else: print(n, end=", ") using the method enumerate to find the last digit or for i in z: n = 2**i if…