Questions tagged as 'python'

1
answer

I try to show in an array that a value is peak (it is greater than the number to its right and to its left) python [on hold]

I am learning to use binary trees, the problem is that I have a basic error that I do not know how to solve, I am new to Python: print('ingresa el rango del array:') rango=int(input()) array=[] for i in range(rango): print ('ingresa el nu...
asked by 18.09.2018 / 09:28
1
answer

Function error

I have a problem that I can not solve. The program works a good part, but when you add a function more find_movie (), it has the functionality to show and add the added movies plus the ones you are looking for. functions enter what the user type...
asked by 18.09.2018 / 00:06
1
answer

Django pass parameter does not work

I hope you can help me, I'm trying to make a function in which passing the parameter can render different template but I do not know what is wrong if the views or the url, someone helps me? views. def hola(request, par): #val = val...
asked by 27.09.2017 / 15:59
1
answer

Change directory in python

I need to change directory to execute a command, looking for several alternatives but none works, in all I get "No such file or directory". I run the script on a server, from nginx. The script that I run is in / var / www / folder1 / test, and t...
asked by 24.01.2018 / 22:57
1
answer

Doubt at ManyToManyFields Django

I'm new to Django and I'm just learning several things, let's say I have the following model where I have the Person, Car and Loan classes, a person in a loan can select several cars class Persona(models.Model): nombre = models.CharField(m...
asked by 05.01.2018 / 03:09
2
answers

autoincrement in python3

I am a beginner in python3, I have the following code that I am doing and paneas I go in the second option def menu(): print ('Selecciona una opcion') print ('1. Ver') print ('2. Agregar') print ('3. Eliminar') print ('4. Modificar') articulos...
asked by 14.04.2018 / 01:02
2
answers

How can I define a variable in Python using if?

What I basically want to do would be: Set from the inputs a max value and a minimum value but I do not know how to do it. if lado1>lado2 and lado3: ... print("A=lado1") ... if lado2>lado1 and lado3: ... print("A=lado2") ... if...
asked by 04.04.2018 / 21:30
1
answer

print a rectangle with "-" python

I have the following program, I already made an attempt but it does not work out as they ask, here is the statement and the expected result Perform a program that displays a rectangle formed by height n and base m, where n and m are integer...
asked by 18.05.2018 / 22:05
1
answer

Use of Dates in Python [closed]

I am carrying out a program that allows calculating the taxes that a car must pay, knowing its model (year of manufacture) and type (P: Private / T: Taxi / R: Remis). To calculate taxes, keep in mind that: a. Private cars less than 10 years o...
asked by 11.04.2017 / 00:47
1
answer

Error with IF syntax invalid

I'm creating this function in Python: def myThreshold(I,p): Ibn = I; if((p > 0) && (p < 256)) index = find(I >= p); lbn = lbn * 0; lbn(index) = 255; return lbn but on the line of the if an error app...
asked by 26.09.2018 / 19:11