Instantly share code, notes, and snippets.

View check_fermat.py
def check_fermat(a,b,c,n):
if n < 3:
print("please enter n > 2!")
return
if a**n + b**n == c**n:
print("Holy smokes, Fermat was wrong!")
else:
print("No, that doesn't work.")
try:
a = int(input("enter a: \n"))
View draws_a_grid.py
def print_arg(s):
print(s, end=' ')
def print_four(f,s):
for i in range(0,4):
f(s)
def so_o_doc(h,f,s):
for i in range(0,int(h)):
print_arg(f)
print_four(print_arg,s)
print_arg(f)
View encrypt_file.py
"""
Ma Hoa AES256. Dung cho python 3.5+
Can cai dat pycryptodome. https://pypi.org/project/pycryptodome/
Script nay co su dung code tu: https://eli.thegreenplace.net/2010/06/25/aes-encryption-of-files-in-python-with-pycrypto/
"""
import os, random, struct
import hashlib
from Crypto.Cipher import AES