According to the Python 2.x documentation, it is recommended to use the raw_input function instead of input . Conversely, in the Python 3.x documentation, the raw_input function does not even appear. So does the input...
Hello, I'm having a little problem in my code. I try to generate a list of 4 random integers that do not repeat, but ...
list_num = []
c = 0
v = random.randint(0, 9)
while c < 4 and v not in list_num:
list_num.append(v)
c += 1...
I'm trying to use a pattern to find a certain line in a file, but it's not working.
This is my pattern: row = re.compile(r"(|\s[OX\s]\s{3}|)")
With this I want to basically find this pattern: | | O | X | , that is, I want th...
I'm solving this URI problem that basically asks for the maximum common divisor between two values.
I originally resolved with math.gcd on half a dozen lines, but the code was not accepted since the URI uses a version of Python 3 pri...
I installed two modules in Python via anaconda (conda install):
zipfile36 ;
MySQLdb .
Using the anaconda prompt I get the version of both and all my other modules using the command:
conda list
But I would like to know, how ca...
I am studying módulo os of the Python default library and I realize that in many cases a function is allowed to receive as a parameter descritor de arquivo ou diretório some examples are:
os.fchdir(fd)
Change...
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?
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...
Imagine that we have a CSV file called data.csv:
col1 col2 col3 col4
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15
33 44
import numpy as np
import pandas as pd
po =...
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...