Posts by Homero • 31 points
12 posts
-
-3
votes1
answer65
viewsQ: Place the information contained in Linha2[0:6] in a ". txt file
Place in a file ". txt" the information contained in Linha2[0:6] which is: ['Mem ria', 'f¡sica', 'total:', '7.988', 'MB'] ['Memria', 'f¡sica', 'available', '5.277', 'MB''] ['Mem ria', 'Virtual:',…
-
0
votes0
answers39
viewsQ: Parsing data in a file containing systeminfo information
A "txt" file containing command return information was generated systeminfo, and I need to be able to copy some of the lines of the file, in this case, the ones that contain information about: total…
python-3.xasked Homero 31 -
0
votes0
answers161
viewsQ: Receive a keyboard URL and drip it into Python
Receives a URL typed via keyboard Ping the respective URL Returns the ip (if any) of the entered URL Ex.: Type a URL: www.google.com Pinging www.google.com [172.217.162.164] with 32 bytes of data:…
-
0
votes2
answers37
viewsA: The program must consider all possible validations. That is, it cannot be allowed to access, delete or change a non-existent position from the list
Answer: import sys lista = [] resposta = '' continua = '' while resposta != 'S': print('#### MENU ####') print('[L]istar') print('[I]nserir') print('[A]lterar') print('[D]eletar') print('[S]air')…
-
0
votes2
answers37
viewsQ: The program must consider all possible validations. That is, it cannot be allowed to access, delete or change a non-existent position from the list
How to put a statement that the position in the list is empty and that it is not possible to change or delete the value import sys lista = [] resposta = '' continua = '' while resposta != 'S':…
-
2
votes3
answers1084
viewsA: Python Online Library of Justice
Your program is practically ready, only needing small adjustments that I think you should have done, but in any case "there you go" (with the numbers I tested worked): x = int(input()) impar = 0…
-
0
votes3
answers152
viewsA: Separate the result that appears in os.getcwd() to be able to display only c:
Make a program that displays the current directory (which you are saving your programs to), the disk drive used, the system user name and the current folder. Consider the example below. Tip use…
-
0
votes3
answers152
viewsQ: Separate the result that appears in os.getcwd() to be able to display only c:
Make a program that displays the current directory (which you are saving your programs to), the disk drive used, the system user name and the current folder. Consider the example below. Tip use the…
-
0
votes2
answers65
viewsQ: How to do the inversion of what is received with comma addition?
Program that receives a name via keyboard and must print the last name, first name and other abbreviated names ex.: receives "Luis Costa Santos" and returns "Santos, Luis C." lista = [] nome = ''…
-
0
votes1
answer177
viewsQ: select one of the words contained in the list
Type a word in a list and then search for the typed word lista = [] i = 0 palavra = '' while (palavra.lower() != 'sair'): i += 1 palavra = str(input('digite alguma palavra: ')) lista.append(palavra)…
-
0
votes2
answers99
viewsQ: invalid.syntax appears when the program is run
I’ve tried to put palavra = '' and the same error keeps appearing: lista = [] i = 0 while (palavra != 'Sair') or (palavra != 'sair'): i += 1 palavra = str(input('digite alguma palavra: ')…
-
0
votes0
answers25
viewsQ: Smallest number typed shows zero always
numero = 0 resposta = 'ok' num_total = 0 contador = 0 maior_num = 0 menor_num = 0 tot_pares = 0 aux = 0 while (resposta == 'ok'): contador += 1 numero =…