Questions tagged as 'python'

1
answer

Is there a Tag in Django to show part of the text?

I would like to know if there is any tag to show part of a description {{ post.description | tag-aqui }}     
asked by 07.07.2017 / 20:29
1
answer

Python - Conditional expression

Hello, I'm learning Python and in my studies I came across the following situation: >>> responses = ['Y', 'Yes', 'No', 'no', '', 'Yep'] >>> responses = [x[0].lower() if x else 'n' for x in responses] >>> responses...
asked by 08.07.2017 / 19:02
1
answer

Calculation Average True Range

I have the following problem: I performed the calculation of ATR (Average True Range) using the numpy library, there was no code problem (exception, etc ...) however, the result shows a small decimal difference when compared to software that als...
asked by 11.05.2017 / 14:58
1
answer

Search for an element in the list

   Make a program that manages the vestibular result. For your happiness, there is only one course and the course has 10 places. The program must maintain the list of 10 classified. The program also maintains, in another list (20 positions), the...
asked by 12.05.2017 / 15:19
1
answer

Same code producing distinct results in Codeenvy and Windows 8.1

I had made the following code in codevy.io and the Python installed in codenvy is 3.5.1. I got this code and put it to run on windows 8 with python 3.6.1. The purpose of the code is to clean up a CSV file and write them concatenated in a sing...
asked by 05.05.2017 / 16:52
1
answer

How to redirect url with argument to another page in Django? (UpdateView, GenericView)

Well, I have a very pertinent question. I have a django editing class, and when I edit the user, I need it to call the detail class of it (DetailView), the two classes are working, but when I call the url that sends the DetailView, it gives an e...
asked by 05.06.2017 / 16:08
1
answer

Python API to get real-time commodity values

I need an API that can provide real-time commodity prices (more specifically, Arabica coffee prices) I know almost nothing about the stock market, but I did a little research and found that the "symbols" used for Arabica Coffee are something...
asked by 04.06.2017 / 02:44
1
answer

While Exercising for Proof

I can not do this exercise, neither with while nor with for. If you can give me the way you do with While and For, I'll be grateful.    Given a list of numbers, say the largest number on the list. Use the len () function to find out the list...
asked by 24.05.2017 / 19:19
1
answer

Pick up an item from a list

Good morning, I've been trying to make a mini game, where I enter the words in the WORDS variable and the same type the name randomly, so far Ok. But I wanted to change and I can not do what I want because I can not find a way to do the same. (I...
asked by 23.05.2017 / 13:23
1
answer

Check Continence python list

I would like help with a code. lista1 = [5, 6, 7] lista2 = [4, 'a', 9, 5, 6, 7] Make sure that list1 (the entire list) is contained in list2 and lista2 = [4, 9, 5, 'a', 6, 7] Do the same check, but now it's negative.     
asked by 09.05.2017 / 18:10