File tree 3 files changed +20
-13
lines changed
3 files changed +20
-13
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ Com o objetivo de alcançar uma abrangência maior e encorajar novas pessoas a c
68
68
| -------------------------------------| -------| ------| --------| ----| ------| ----| --------| -------| ------|
69
69
| Lista com 2 Pilhas | C/C++ | Java | [ Python] ( ./src/python/lista_com_pilhas.py ) | Go | Ruby | JS | Pascal | Swift | Rust |
70
70
| Soma de 2 Números | C/C++ | Java | [ Python] ( ./src/python/soma_dois_numeros.py ) | Go | Ruby | JS | Pascal | Swift | Rust |
71
- | [ Palíndromo] [ 49 ] | [ C/C++] ( ./src/c/Palindromo.c ) | Java | [ Python] ( ./src/python/palindromos .py ) | Go | [ Ruby] ( ./src/ruby/Palindromo.rb ) | [ JS] ( ./src/javascript/Palindromo.js ) | Pascal | [ Swift] ( ./src/swift/palindromo.swift ) | [ Rust] ( ./src/rust/palindromo.rs ) |
71
+ | [ Palíndromo] [ 49 ] | [ C/C++] ( ./src/c/Palindromo.c ) | Java | [ Python] ( ./src/python/palindromo .py ) | Go | [ Ruby] ( ./src/ruby/Palindromo.rb ) | [ JS] ( ./src/javascript/Palindromo.js ) | Pascal | [ Swift] ( ./src/swift/palindromo.swift ) | [ Rust] ( ./src/rust/palindromo.rs ) |
72
72
| Lista Ligada Desordenada | C/C++ | Java | [ Python] ( ./src/python/lista_encadeada_desordenada.py ) | Go | Ruby | JS | Pascal | Swift | Rust |
73
73
| [ Calculo do PI (Leibniz)] [ 50 ] | C/C++ | Java | [ Python] ( ./src/python/calculate_pi.py ) | [ Go] ( ./src/go/calculatepi/calculatepi.go ) | Ruby | [ JS] ( ./src/javascript/calculate_pi.js ) | Pascal | [ Swift] ( ./src/swift/calculatePi.swift ) | [ Rust] ( ./src/rust/calculate_pi.rs ) |
74
74
| Busca em Labirinto | C/C++ | Java | [ Python] ( ./src/python/busca_em_labirinto.py ) | Go | Ruby | JS | Pascal | Swift | Rust |
Original file line number Diff line number Diff line change
1
+ # A simple way to resolve the palindrome problem
2
+ # Note: this example does not deal with punctuation
3
+
4
+
5
+ def is_palindrome (content ):
6
+ processed_content = '' .join (content .lower ().split ())
7
+ return processed_content == processed_content [::- 1 ]
8
+
9
+
10
+ if __name__ == '__main__' :
11
+ assert is_palindrome ('ovo' )
12
+ assert is_palindrome ('osso' )
13
+ assert is_palindrome ('Arara' )
14
+ assert is_palindrome ('Amor a Roma' )
15
+ assert is_palindrome ('O lobo ama o bolo' )
16
+ assert is_palindrome ('A grama é amarga' )
17
+
18
+ assert not is_palindrome ('Sentido' )
19
+ assert not is_palindrome ('Algoritmos' )
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments