Questions tagged as 'python-3.x'

1
answer

How to check the type of the elements of a list in Python?

I have a list of data, and I need to verify that all elements are integers or string , or any other data type. Is it possible to check all the elements or need to be one by one? For example: Lista = [0,1,2,3,4,5,6,"7"] I need a function...
asked by 19.01.2018 / 14:13
1
answer

Python: Clean html code

Using python, what would be the easy way to clean tag parameters from Microsoft tools? Initially I'm trying to turn via beautiful soup, but I'm open to any suggestions! : D In this way: <p style="text-decoration: underline;">Hello...
asked by 22.02.2018 / 10:07
1
answer

How to save the result to a file?

Well, I'm doing a program that takes the spaces of sentences, letters, words, and puts each "phrase / letter / word" one underneath the other. For example: The "phrase / letter / word": BAB BBA ACA AAB BCB CBB ABC CBC BBB ACA BCB CBA CBA CCB A...
asked by 12.01.2018 / 00:52
3
answers

Syntax error in Python code. Which is? [closed]

print("**************") print("Seja Bem Vindo") print("**************") numero_secreto = 65 chute = input("Digite um numero:") print("Você digitou: ",chute) if numero_secreto == chute print("você acertou") else print("Você errou, Tente no...
asked by 16.12.2017 / 00:41
2
answers

Put the data that is typed into the input into a list

I need to store the 10 numbers entered by the user into a list, only using the "for". for c in range(0, 10): s = int(input()) So I would just need to know how I store each number after being typed and not just the last one, as I do curr...
asked by 09.12.2017 / 16:25
2
answers

How do I access a private attribute in a class?

Write a banking program that you have: Uma classe Banco com os atributos - private total - public TaxaReserva - private reservaExigida E métodos - public podeFazerEmprestimo(valor) --> bool - public MudaTotal(valor) And a class has attr...
asked by 01.04.2018 / 22:49
2
answers

How to write a book in alphabetical order of names, if the dictionary structure has no order?

Write a program that receives as many entries as you want and then create a new contact for each entry (Name, Phone, Address, Email), and Finally, print the contact list in alphabetical order: Nomes = [] Telefones = [] Endereços = [] Emails =...
asked by 31.03.2018 / 01:21
2
answers

Find the problem of my list of objects in Python

Well, I'm asking you this question, since I've tried several ways, but I can not find the error in logic or the wrong use of some syntax in python. It would be as follows, I have this class: class PalavraIndices(object): def __init__(self...
asked by 08.10.2017 / 04:27
1
answer

How to write a .csv file in Python including file definitions?

How can I create a csv file containing column width information and configured header and stuff like that, is it possible? or can we just write the data without any configuration?     
asked by 24.01.2018 / 14:15
1
answer

Select data from a worksheet

I read data from a spreadsheet using Python 3 libraries (xlrd / xlsxwriter / Pandas and Numpy). This worksheet has in the lines questions of the survey and in the columns the areas that answered the survey. Each sentence has a note, ranging from...
asked by 24.11.2017 / 01:02