Learn Python

Learn Python

Share

Photos from Learn Python's post 21/11/2022

Is your birth date magical? Simple python program to see how magical you are!
Paste this code in your IDE, or online Python Interpreter and see the magic:

-----------------------------------------------------------------------

import random
magic_number = random.randint(1, 31)
my_birthdate = int(input('Enter your birhday date: '))
if magic_number == my_birthdate:
print('You are magical')
else:
close = abs(magic_number - my_birthdate)
if close > 5:
print('You are ', close, ' numbers away to magic')
else:
print('You are ', close, ' numbers close to magic')
print('Magic number: ', magic_number)

20/11/2022

Important Python Datatypes

Want your school to be the top-listed School/college in Mumbai?
Click here to claim your Sponsored Listing.

Telephone

Address


Mumbai