Skip to content

Creating a Tuple with a variable and Boolean Python

I’m supposed to add a variable and a boolean to a new Tuple – the actual assignment is below, with my code. I know tuples are immutable – this is the first time I’ve tried to make one. Additionally, I can’t find anything about inserting the variable and a boolean. Thanks in advan…

Google kickstart 2020 round A wrong answer

link to problem : https://codingcompetitions.withgoogle.com/kickstart/round/000000000019ffc7/00000000001d3f56 Problem There are N houses for sale. The i-th house costs Ai dollars to buy. You have a budget of B dollars to spend. What is the maximum number of houses you can buy? Input The first line of the inpu…

Python 2.7.12 on Ubuntu 20.04 in PyEnv

I have some legacy websites that run on Python 2.7.12 and have just updated my dev machine to Ubuntu 20.04. I am trying to get PyEnv to install Python 2.7.12, but it seems that this depends on libssl1.0-dev which has been dropped in Ubuntu 20.04. I get error: Following advice here I run: I get error: E: Packa…

Import Data from .csv file into mysql using python

I am trying to import data from two columns of a .csv file (time hh:mm, float). I created a database and a table in mysql. If I run the program with executemany(), result is the following: [’01:00′, ‘1’] ‘-1 was inserted.’ and after this I do get the error code: Not all par…