Teaching Rafi Python

I'm Jannat. My brother Rafi is 12 and wanted to "make a game". He's too young for his own account, so he sits next to me, his files live in ~jannat/rafi, and we do 30 minutes after his homework. This is the log.

Day 14: সংখ্যা ধরো

import random

number = random.randint(1, 50)
tries = 0
print("১ থেকে ৫০ এর মধ্যে একটা সংখ্যা ভেবেছি। ধরো তো!")

while True:
    guess = int(input("তোমার অনুমান: "))
    tries += 1
    if guess < number:
        print("আরো বড়!")
    elif guess > number:
        print("আরো ছোট!")
    else:
        print(f"ঠিক! {tries} বারে পারলে।")
        break

Run it yourself: python3 ~jannat/rafi/guess.py on mukto.net. Next week: lists, and a hangman game with Bangla words.