-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestaStringCheia.py
executable file
·61 lines (33 loc) · 1019 Bytes
/
testaStringCheia.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import io, sys, string
def testaStringCheia(string, modo): # (string, 1) é meu preferido
teste = None
lista_teste = []
print(type(string))
if isinstance(string, str): #saber se tá vazio
for letra in string:
lista_teste.append(bool(letra))
if letra != " ":
teste = True
if modo == 1 : # limitar string apenas a segurar letras, sem numeros
if letra.isnumeric() == True :
#print(letra.isnumeric)
teste = False
else:
teste = False
print(lista_teste)
#for booleano in lista_teste:
# if booleano == True:
# print(booleano + " não é vazio.")
else:
print("[DEBUG] testeStringCheia diz que você entrou com:")
print(type(string))
if teste == True :
print("[DEBUG] testaStringCheia() = True")
return True
else:
print("[DEBUG] testaStringCheia() = False")
return False
def main():
testaStringCheia(input("Entre com uma string:\n --> ") , 1)
if __name__ == '__main__':
main()