Questions tagged as 'python-3.x'

1
answer

error: (-215: Assertion failed)! empty () in function 'detectMultiScale'

I'm totally lazy in linux and I'm trying to use opencv version 3.4.2 with python 3.5.2 in linux mint to run an example facial detection code. Below the code: import numpy as np import cv2 classificador = cv2.CascadeClassifier('\home\linux\Doc...
asked by 29.07.2018 / 03:43
1
answer

How to start the full screen window with tkinter?

from caixaimport import * # Variables # Tkinter Variables win_width, win_height = 1280, 1024 windows = Tk() # start a variable Tk windows.geometry(f'{win_width}x{win_height}') windows.title('SCH payment system') # putting a title in variabl...
asked by 06.03.2018 / 01:40
1
answer

Django session, issue: Object of type '' is not JSON serializable

I am creating a student but when I try to save it inside a session, it returns the following error: Object of type 'Student' is not JSON serializable No settings.py: INSTALLED_APPS = [ 'django.contrib.admin', 'django....
asked by 21.08.2018 / 20:36
1
answer

Bubble Sort in Python3

def bubble_sort(list): for i in range(len(list)): for j in range(len(list)-1): if list[j] > list[j+1]: list[j], list[j+1] = list[j+1], list[j] else: continue I just did this bubble sort, but I...
asked by 04.07.2018 / 14:55
2
answers

Identify the day of the week of a certain date

One of the questions of a college assignment is giving work for the whole class, so far no one has been able to answer question 4. A friend of mine tried with this code, but it does not work right, because depending on the entries, the month leav...
asked by 27.04.2018 / 02:41
2
answers

What are the statements placed before strings?

In python, I noticed that these "statements" were placed in two cases, first, in strings before passing through a hash algorithm, eg:    import hashlib       m = hashlib.sha256 ()       m.update (b "Nobody inspects") Note: The reference...
asked by 03.09.2017 / 19:32
4
answers

Repeat to call variables

I have four variables [t1, t2, t3, t4], and each of them has been defined as a string before. t1 = 'A vida vai ficando cada vez mais dura perto do topo.' t2 = 'A moralidade é a melhor de todas as regras para orientar a humanidade.' t3 = 'Aquil...
asked by 02.04.2018 / 00:12
1
answer

Recursion - I want to count how many times 3 and 4 appear

I want to count how many times 3 and 4 appear. What is going wrong? def count(x): y=0 if x[0]=='': print(y) return if x[0]=='3': y=y+1 return count(x[1:]) count('23334')     
asked by 16.05.2017 / 00:14
1
answer

How do the elements of a tuple be the arguments of a function in python?

First I'll summarize the problem and then explain what I'm trying to do. If you can answer the problem in a nutshell, you do not even have to see the rest. Is there a way to pass the elements of a tuple as arguments to a function? For example:...
asked by 08.05.2017 / 02:09
3
answers

A list to receive 20 integers and store in a list and print the largest element in the list

n = int(input("digite o número : ") I=0 For i in lista: lista[i].append(input("digite o número" I+=1 else: Print("lista cheia") I'm new to Programming and I can not deploy what the questionnaire wants.     
asked by 10.05.2017 / 19:42