Posts by Bender-Plus • 59 points
3 posts
-
2
votes3
answers228
viewsA: Compare two lists in python and return matches
Another example with strings could be done this way: If you would like to subtract the same elements: uma_lista = ['oi', 'bem', 'certo'] outra_lista = ['oi', 'belo', 'jeito'] iguais = [elemento for…
-
0
votes3
answers179
viewsA: Basic Python repetition - doubt in "and" and "or"
To identify different numbers of pairs, you can use the function below: for c in range(1, 501, 2): # Somente números ímpares if c % 3 == 0: # Verifica se numero ímpar é divisível por 3 print(c,…
-
3
votes4
answers167
viewsQ: How to return the first vowel of several words in a list?
The code is partially done, but it returns only the vowels found in each word. How could I return only the first vowel of each word? palavras = ('boi', 'vaca', 'macaco', 'ovelha', 'lesma',) vogais =…