CoolFace
Apppublic

jupyterppl/Math-Game-for-Programming

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
ACT 2 APP.py38 linesDownload Raw Back to root
1#!/usr/bin/env python2# coding: utf-83 4# In[1]:5 6 7import random8 9 10# In[4]:11 12 13# Generate 'a' and 'b' seperately14a = random.randint(1, 10)15b = random.randint(1, 10)16 17 18# In[10]:19 20 21answer = int(input(f"What is {a} + {b}? "))22 23 24# In[6]:25 26 27if answer == (a + b):28    print ("Correct! Ang galing mo nak")29else:30    print(f"Wrong. The answer was {a + b}.")31 32 33# In[ ]:34 35 36 37 38