Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save spoterianski/d4a8e3d39eaa25bcaf715466f5662e3f to your computer and use it in GitHub Desktop.
Save spoterianski/d4a8e3d39eaa25bcaf715466f5662e3f to your computer and use it in GitHub Desktop.
Генератор примеров для вычитание четырехзначных чисел
# Математика 4 класс
# Генератор примеров для вычитание четырехзначных чисел
import random
res = []
for i in range(20):
a = random.randint(100, 9999)
b = random.randint(100, 9999)
if b > a:
a, b = b, a
print(f'{i})\n')
print(str(a).rjust(5, ' '))
print('-')
print(str(b).rjust(5, ' '))
print(' ----\n\n\n\n')
res.append(f'{i}) {a} - {b} = {a - b}')
for x in res:
print(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment