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...
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...
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
>...
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...
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...
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 ....
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...
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],...
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...