Questions tagged as 'python'

3
answers

get the 3 largest numbers from a list in python

Can someone help me find the error?    "" "" # TODO: implement this function def top_three(input_list): list1 = [2,3,5,6,8,4,2,1] input_list = sorted(list1, reverse=True) return input_list[:3] print (t...
asked by 23.07.2017 / 02:15
2
answers

Find the largest palindrome made from the product of two 3-digit numbers - Python

I have a problem. I'm creating an algorithm in Python to find the largest palindrome made from the product of two 3-digit numbers. Code: i = 0 while i <= 999: temp = str(i * 999) tempInverso = temp[::-1] if temp == tempInvers...
asked by 02.08.2017 / 22:19
2
answers

Append methods in a list - Python

I tried to add 4 methods in a list (methodList): def setVar(self, number): self.var = number methodList = list() for y in range(4): methodList.append(setVar(self, y)) and the function does not work: >>> self.var = 0 >...
asked by 18.09.2015 / 21:12
2
answers

Is there any way to write a web code without a python framework?

I find python a very interesting language. And as a web developer, I'd like to use it for this purpose. I know there are good frameworks like Flask and Django . But if I wanted to write small test-only code, would there be any wa...
asked by 12.09.2015 / 18:51
1
answer

Find equal values between 2 different .csv columns and update another column X

Hello, I have two .csv files as below: .csv1 POS,ID 28000167,. 28000263,. 28000484,. 28000711,. 28000728,. 28000885,. 28089922,. 28089927,. 28090173,. 28090325,. 28090326,. 28090331,. 28090415,. 28090467,. 28096247,. 28096264,. 28096284,...
asked by 02.03.2017 / 02:57
2
answers

Database graph does not appear python matplotlib

The outline of the graph appears, but empty, with no data. import sqlite3 import matplotlib.pyplot as plt import matplotlib.dates as mdates connection = sqlite3.connect('escola.db') c = connection.cursor() sql= "SELECT DATE_EXTRACTION, NOT...
asked by 05.03.2017 / 22:08
2
answers

How to request input data N times, and concatenate this data

First I asked the user to enter the amount of links he wanted to add to the file (in this case a string ), hence if he type 4, I want ask the question "Download Link:" four times for it and add all the answers to that question in a string ....
asked by 06.04.2015 / 04:02
2
answers

Deploy a program that receives a name and displays only the last name and the first name

I made it this way: nome=input('Digite seu nome completo:').title() lista=nome.split() print(lista) print(lista[-1],',',lista[0]) But at the time of printing it looks like this: Fulano , Ciclano I would like it to stay like thi...
asked by 07.10.2018 / 21:01
4
answers

Remove rows from numpy array

For example I have array arr1 and I want to take a row range of this array as below, what function can I use? arr1: array([[ 1, 1, 1], [ 2, 2, 2], [ 3, 3, 3], [ 4, 4, 4], [ 5, 5, 5], [ 6, 6, 6],...
asked by 18.10.2018 / 22:19
1
answer

Multiprocessing in Python

I'm creating processes using multiprocessing in Python, but I need to create processes inside other processes, that is, child processes. Is it possible to do this using multiprocessing ? Code: import time import multiprocessing...
asked by 05.10.2018 / 03:41