Questions tagged as 'python'

2
answers

Importing modules with Python

How can I make import libraries, for example, I was searching and found Babel to do internationalization of dates, but I do not know how to import this library?     
asked by 07.08.2015 / 02:43
2
answers

Replace words between two files

I'm trying to make some substitutions between two files: if a word from file 1 is in the second column of file 2, replace that word from file 1 with the word from the first column of file 2 File 1:    bought large carpet expected large p...
asked by 29.06.2018 / 13:50
2
answers

Python: How to transform a method or a class into obsolete?

This time I want to learn about structures in Python packages, and I need your help again. How to make a method or class obsolete? How to display a message in the interpreter's debugger when a method or class is no longer supported?     
asked by 12.05.2018 / 12:57
3
answers

Request n entries in python

I am having difficulty in this exercise: "Make a program that asks n people their age, at the end the program should check if the average age of the class varies between 0 and 25, 26 and 60 and greater than 60, and then say if the class is "y...
asked by 11.11.2017 / 23:55
1
answer

Join three similar codes in one

I'm working with a table that shows the number of places offered, candidates who are enrolled and those who enter higher courses. I want to make a program that allows the visualization of this data from the user's input (let's say he wants to kn...
asked by 09.01.2018 / 04:35
1
answer

How to do a "compilation" of the code in Python?

Knowing that Python is an interpreted language, is there any way to compile the program in Python? By that I mean, how to check for syntax errors without having to expect such a part of the program to occur for verification. Because errors are o...
asked by 25.01.2018 / 11:17
1
answer

Pandas - select rows

Hello. How do I select a specific row in a dataframe? df1=pd.read_csv('arquivo1.csv', encoding='ISO-8859-1', sep=";") I have tried to df.index[2] , but it gives error. The 2 is the line I want.     
asked by 02.11.2017 / 18:05
1
answer

Calculating the maximum value for an expression of natural numbers using Python

Two natural data m and n determine, among all pairs of natural numbers (x, y) such that x < m e y < n, a pair for which the value of the expression x * y - x ** 2 + y is maximum and also calculate this maximum. I solved the problem like this:...
asked by 22.03.2018 / 23:20
1
answer

Print in ascending order the first natural n's that are multiples of i or j or both

Given n and two positive integers i and j other than 0, print in ascending order the first natural n's that are multiples of i or or both. Example: For n = 6, i = 2 and j = 3 the output should be: 0,2,3,4,6,8. n = int(input("Digite n: "))...
asked by 23.03.2018 / 03:55
2
answers

Multiplying list terms

I want to print the multiplication of terms and I would like to know if there is any function that can do this for me in the Python language: lista = [] con = 0 while(con<5): n = int(input('insira um número inteiro')) con = con +...
asked by 16.10.2018 / 11:56