Skip to content

if else Conditions

The problem is like this My solution: Now, if I enter 18 then it should be printed “Weird”. But it is showing “Not Weird”. I am not getting where the problem of my code is. Answer The operator & is the bitwise and operation. You need logical AND, instead, and it is done by means of…

Python sorted not sorting Counter output properly

I am trying to sort out min page load time and max page load time from Apache access log file. After parsing the log file and sorting using sorted I am seeing weird sorting. The above code sorting thousandths and only then sorting hundreds: As you see 455 and 677 are at the end, but if you look separately at

Display Kivy canvas inside GridLayout

I am trying to reference to Canvas within GridLayout with just drawing simple rectangle before further development. Code: main.py: my.py After running i get error: I am new in kivy, so any help is appreciated. After solving this issue, I am planning to run custom python func , run under button calc, and retur…

Plotting different shape 2D arrays in matplotlib

I couldn’t find any answer to this specific case. Say I want to create a scatter plot from the following data: Where all the values of y[0] are the correseponding values of X[0] (86) and so on. I know I can just use numpy repeat function but I thought maybe there’s any other more feasilbe option? …