Posts by Mário César Fracalossi Bais • 26 points
2 posts
-
0
votes1
answer76
viewsA: How to print lines that have a certain word in python?
Just invert the test parameters. Original: if line in 'Python' or 'python' : print(line) Proposal: if 'Python' in line or 'python' in line: print(line)
-
0
votes8
answers4052
viewsA: How to generate 200,000 primes as fast as possible in Python?
All cousins up to 2,000,000 - takes reasonable time; for 200,000 is fast. m = 200000 # para calcular primos até esse número m # constrói a list comprehension excluindo os divisíveis pelos menores…