Questions tagged as 'python-2.7'

1
answer

Reuse of functions in Python

I am a beginner in programming and I have the following situation: I have a class called TEST. Within this class has the RANDOM function. I have a second class called CHECK. Within this class you have the CHECK function. I want the...
asked by 16.05.2017 / 15:06
1
answer

How to format input with float and range in Python 2?

I need to make an average calculator (student notes) where the entries have a decimal place and are in the range [0, 10]. The outputs must have five decimal places and so far, with what I have been able to describe, the code is: a = float("%.1...
asked by 26.04.2017 / 16:53
2
answers

help with indentation that is generating error in python 3.6

I'm doing a webcrawler I'm having the following problem. I had to do a separate program to print out how many candidates passed each course. Except that the last line is not being executed, and that it would make the vector names go to the next...
asked by 02.03.2017 / 23:24
1
answer

TypeError: list indices must be integers, not tuple

I have a code that calculates the Euclidean distance between two points. However, when I execute it it presents the error: "TypeError: list indices must be integers, not tuple" I do not know what I'm doing wrong. Below the code: impo...
asked by 07.03.2017 / 01:38
2
answers

How to include content from a page .py on another page .py

How do I make a include or open a python page in another, for example in php : include 'content/filename.php'; Load the Html it loads the file .py no, I already tried the command open fp = open('content/header.py') h...
asked by 13.11.2016 / 15:56
2
answers

Calculating Series in Python

How to calculate series in Python? I've created an algorithm but I'm not making it to the end goal. Ex: S1 = x + (x-1) + (x – 2) + ... + (x – n) S2 = 1
asked by 01.12.2016 / 13:45
1
answer

How to print a function in Python?

I'm trying to make this code work but I'm not getting it. Enter the name and year of birth, and return the correct values dps, but not able to return the number of years ... What is my error? print 'Digite seu nome:' nome = raw_input() pri...
asked by 19.09.2016 / 04:35
1
answer

Python - PHPSESSID

I'm trying to create a script that enters a website without having to log in through the requests library. I want to do this using the PHPSESSID cookie. How can I do this?     
asked by 01.08.2016 / 15:53
1
answer

Python --ValueError: incomplete format

Can anyone help me with this code? I have two problems: The first is the error mentioned in the title and the second is the function vector, which does not receive assignment (when I was debugging in the compiler, I realized that U was not recei...
asked by 14.05.2016 / 01:45
1
answer

Read excel information in array form with python

I'm using Python 2.7 to read values from an Excel document. When I have only one line of values with its header I can read, doing from openpyxl import Workbook from openpyxl import load_workbook wb = load_workbook("Resultados.xlsx") Nod=49 #nu...
asked by 22.07.2016 / 17:25