Python on Ubuntu 18.04.6 LTS

Python on Ubuntu 18.04.6 LTS

Shlomo Solomon shlomo.solomon at gmail.com
Tue Jan 4 06:43:35 IST 2022


NOT an answer to your question, but instead of a link to python3.8, I
added 2 lines to .bash_aliases:

alias p="python3.8"
alias p2="python2.7"



On Tue, 4 Jan 2022 06:07:43 +0200
אורי <uri at speedy.net> wrote:

> Hi,
> 
> /usr/bin/python is defined on my server as a link to the
> deprecated python2.7, and I didn't want to break anything, so I
> defined /usr/bin/_py as a link to python3.8. I wanted to check how
> many bytes a giga and tera is, so I ran _py -c "print(1024**3)" and
> _py -c "print(1024**4)". Then I checked  _py -c "print(2**64)" and I
> wanted to check _py -c "print(2**64**3)", which I thought will be
> equal to  _py -c "print(2**192)" (_py -c "print((2**64)**3)"), but no
> - this gave me a number with 78914 digits and I'm glad it didn't
> crash my server (4 or 5 or 6 would have crashed it). Since when
> 2**64**3 is  2**(64**3) and not (2**64)**3? Anyway I also checked
> 2**10**6 (==2**1000000) and I found out that it contains exactly 10%
> digits of 6, and I even created a small program to calculate the
> powers of 2 that give exactly 10% digits of 6. Are there powers of 2
> which give exactly 10% of each of the digits 0 to 9 (in decimal form)?
> 
> for n in range(1, 10 ** 6 + 1):
>     a = 2 ** n
>     b = list(str(a))
>     s = sum([1 if i == "6" else 0 for i in b])
>     if (s * 10 == len(b)):
>         print(n, len(b), s)
> 
> Thanks,
> 
> אורי
> uri at speedy.net



-- 
Shlomo Solomon
http://the-solomons.net
Claws Mail 3.17.5 - KDE Plasma 5.18.5 - Kubuntu 20.04



More information about the Linux-il mailing list