Easy Python Program Virtual Tibetan Prayer Wheel TQDM Example Free Code

print("""
    Welcome to Virtual Tibetan Wheel Program. This program takes a mantra of your choice and 
    recites ** (saves as a text file) 1008 Times for each rotation of the wheel. You will specify 
    the number of times you want to turn the wheel. The text file with recited mantra in multiples 
    of 1008 is saved in the current directory as MantraChant.txt. Avoid specifying excessively big
    number in turns as it may result in an excessively large file being produced.
    """
)

from tqdm import tqdm
from art import *
chant = input("     Which mantra do you want to chant: ")
f = open("MantraChant.txt" , 'w')
chantlist = chant.split(" ")
twowords = (chantlist[:3])
twowords = ' '.join(twowords)

spin = int(input("     How many times do you want to spin the TIBETAN WHEEL: "))
mantra = text2art(twowords)
print(mantra)
for num1 in tqdm(range(1008)):
    for num2 in (range(spin+1)):
        #print(chant)
        f.write(chant + "\n")
f.close()
print("""
    Thank you for spinning the Virtual Tibetan Wheel. The recited mantra is saved as txt file in
    the current directory. Run the program again to spin the wheel. 


""")

Easy Python Project Memory Address Mapping for MP and MC Free Code

import math
import os

os.system("")

# Group of Different functions for different styles
class style():
    BLACK = '\033[30m'
    RED = '\033[31m'
    GREEN = '\033[32m'
    YELLOW = '\033[33m'
    BLUE = '\033[34m'
    MAGENTA = '\033[35m'
    CYAN = '\033[36m'
    WHITE = '\033[37m'
    UNDERLINE = '\033[4m'
    RESET = '\033[0m'

    #############
    # SECTION 1 OF THE PROGRAM FOR GENERATING ADDRESS LOCATIONS.
    #############
print("")
print("MEMORY ADDRESS MAPPING TOOL FOR MICROPROCESSORS AND MICROCONTROLLERS")
print('''   
This tool lets you calculate the total number of address locations [in hexadecimals], "
in the memory of a specific size with a specific register size. This tool can be used as
a building block for creating memory segmentation and multiple RAM/ROM implementations''')
while True:
    print("")
    print(style.YELLOW + " WELCOME TO MEMORY MAPPING TOOL FOR MICROPROCESSORS AND MICROCONTROLLERS" + style.RESET)

    try:

        n = int(input(style.CYAN + " Enter Memory Size (preferably an integer in multiples of power of 2) : " + style.RESET))
    except ValueError:
        print("Enter Valid Input Please")
        break

    m = (input(style.CYAN +" Enter Memory Multiplier [(B)yte, (k)ilobyte, (M)egabyte, (G)igabyte, (T)erabyte )] or (Q)uit: " + style.RESET))
    #memorysize(n,m)
    if m.lower() == "k":
        s = n * 1024
        t = math.log2(s)
        sizeinbytes = int(2 ** t)
        print(" Total Memory Size in Bytes is : ", sizeinbytes, "B")

    elif m.lower() == "b":
        s = n
        t = math.log2(s)
        sizeinbytes = int(2 ** t)
        print(" Total Memory Size in Bytes is : ", sizeinbytes, "B")

    elif m.lower() == "m":
        s = n * 1024 * 1024
        t = math.log2(s)
        sizeinbytes = int(2 ** t)
        print(" Total Memory Size in Bytes is : ", sizeinbytes, "B")

    elif m.lower() == "g":
        s = n * 1024 * 1024 * 1024
        t = math.log2(s)
        sizeinbytes = int(2 ** t)
        print(" Total Memory Size in Bytes is : ", sizeinbytes, "B")

    elif m.lower() == "t":
        s = n * 1024 * 1024 * 1024 * 1024
        t = math.log2(s)
        sizeinbytes = int(2 ** t)
        print(" Total Memory Size in Bytes is : ", sizeinbytes, "B")

    elif m.lower() == "q":
        print(" Thank you for Trying the Program")
        break
    else:
        print(" Enter a Valid Value")
        break


    #############
    # SECTION 2 OF THE PROGRAM FOR GENERATING ADDRESS MAP.
    #############

    print("")
    mem_map = input(style.MAGENTA +" Do You wish to calculate MEMORY ADDRESS MAP of this Memory : Y or N : ")
    if mem_map.lower() == "y":
        reg_size = int(input(" Enter Register Size in bytes (Multiples of 2 powers ) : " + style.RESET))
        new_memsize = (sizeinbytes/reg_size)
        len_newmem = int(new_memsize)
        if len_newmem > 0:
            print(" Total number of registers in memory of [", n, m, "] are : ", len_newmem)

            print(" The first address of the memory is : " , hex(0) , "H")
            print(" The last address of the memory is : ", hex(len_newmem - 1) , "H")
        else:
            print(" Register Size cannot be greater than the total memory size !!")
            break
    elif mem_map.lower() == "n":
        print(" Thank you for using the Program !!")
        break
    else:
        break


Easy Python Project Greek Alphabet Tutor Free Code

import random
import os

os.system("")

# Group of Different functions for different styles
class style():
    BLACK = '\033[30m'
    RED = '\033[31m'
    GREEN = '\033[32m'
    YELLOW = '\033[33m'
    BLUE = '\033[34m'
    MAGENTA = '\033[35m'
    CYAN = '\033[36m'
    WHITE = '\033[37m'
    UNDERLINE = '\033[4m'
    RESET = '\033[0m'
print(style.YELLOW + """
WELCOME TO GREEK ALPHABET LEARNING PROGRAM
A simple and easy way to learn Greek Alphabets ( both in upper and lower cases). Greek Alphabets are widely used as 
Engineering Symbols in Electromagnetics, Antennas, Linear Control Systems and Signals/Systems Engineering.
Learn the Symbols and then Take a test to know if recognitions of the symbols is completed.

** This program is free to use, distribute and reprogram !! Enjoy **
"""
+ style.RESET
)

greek_alphabets_upper = {
    "ALPHA" : "\u0391",
    "BETA" : "\u0392",
    "GAMMA" : "\u0393",
    "DELTA" : "\u0394",
    "EPSILON" : "\u0395",
    "ZETA" : "\u0396",
    "ETA" : "\u0397",
    "THETA" : "\u0398",
    "IOTA" : "\u0399",
    "KAPPA": "\u039A",
    "LAMDA": "\u039B",
    "MU": "\u039C",
    "NU": "\u039D",
    "XI": "\u039E",
    "OMICRON": "\u039F",
    "PI": "\u03A0",
    "RHO": "\u03A1",
    "SIGMA": "\u03A3",
    "TAU": "\u03A4",
    "UPSILON": "\u03A5",
    "PHI": "\u03A6",
    "CHI": "\u03A7",
    "PSI": "\u03A8",
    "OMEGA": "\u03A9"
}
new_gul ={

    'Α': 'ALPHA', 'Β': 'BETA', 'Γ': 'GAMMA', 'Δ': 'DELTA', 'Ε': 'EPSILON', 'Ζ': 'ZETA',
    'Η': 'ETA', 'Θ': 'THETA', 'Ι': 'IOTA', 'Κ': 'KAPPA', 'Λ': 'LAMDA', 'Μ': 'MU', 'Ν': 'NU',
    'Ξ': 'XI', 'Ο': 'OMICRON', 'Π': 'PI', 'Ρ': 'RHO', 'Σ': 'SIGMA', 'Τ': 'TAU', 'Υ': 'UPSILON',
    'Φ': 'PHI', 'Χ': 'CHI', 'Ψ': 'PSI', 'Ω': 'OMEGA'
}
greek_alphabets_list = ["\u0391","\u0392","\u0393","\u0394","\u0395","\u0396","\u0397","\u0398","\u0399","\u039A","\u039B","\u039C","\u039D","\u039E","\u039F","\u03A0","\u03A1","\u03A3","\u03A4","\u03A5","\u03A6","\u03A7","\u03A8","\u03A9"]

greek_alphabets_lower = {
    "\u03B1" : "ALPHA",
    "\u03B2" : "BETA",
    "\u03B3" : "GAMMA",
    "\u03B4" : "DELTA",
    "\u03B5" : "EPSILON",
    "\u03B6" : "ZETA",
    "\u03B7" : "ETA",
    "\u03B8" : "THETA",
    "\u03B9" : "IOTA",
    "\u03BA" : "KAPPA",
    "\u03BB" : "LAMDA",
    "\u03BC" : "MU",
    "\u03BD" : "NU",
    "\u03BE" : "XI",
    "\u03BF" : "OMICRON",
    "\u03C0" : "PI",
    "\u03C1" : "RHO",
    "\u03C2" : "SIGMA",
    "\u03C3" : "SIGMA",
    "\u03C4" : "TAU",
    "\u03C5" : "UPSILON",
    "\u03C6" : "PHI",
    "\u03C7" : "CHI",
    "\u03C8" : "PSI",
    "\u03C9" : "OMEGA"

}

def learn_greek_alphabets_upper():
    for k, v in greek_alphabets_upper.items():
        print(v, '      ', k)


def learn_greek_alphabets_lower():
    for k, v in greek_alphabets_lower.items():
        print(k, '      ', v)


def test_greek_alphabets_upper():
    r = 0
    w = 0
    for k, v in greek_alphabets_upper.items():

        print("DO YOU RECOGNIZE THIS SYMBOL, " , v , '?')
        userinput3 = input("Name of the Character is :" )

        if userinput3.upper() == k:
            print('Voila !! YOU HAVE LEARNT THE CHARACTER WELL !!!')
            r = r + 1
        else:
            print("Sorry , Learn the Symbol again")
            w = w + 1
            continue
    print(style.RED + "--------------")
    print(" TEST RESULTS ")
    print("--------------")
    print("CORRECT ANSWERS :", r)
    print("INCORRECT ANSWERS : " + style.RESET, w)

def test_greek_alphabets_lower():
    r = 0
    w = 0
    for k, v in greek_alphabets_lower.items():

        print("DO YOU RECOGNIZE THIS SYMBOL, " , k , '?')
        userinput3 = input("Name of the Character is :" )

        if userinput3.upper() == v:
            print('Voila !! YOU HAVE LEARNT THE CHARACTER WELL !!!')
            r = r + 1
        else:
            print("Sorry , Learn the Symbol again")
            w = w + 1
            continue
    print(style.RED + "--------------")
    print(" TEST RESULTS ")
    print("--------------")
    print("CORRECT ANSWERS :", r)
    print("INCORRECT ANSWERS : " + style.RESET , w )



def random_test_greek_alphabets_upper():
    r = 0
    w = 0
    for k, v in new_gul.items():

        letter , name = random.choice(list(new_gul.items()))
        print("Recognize This letter: " , letter)
        answer = input(" Enter Your answer: ")

        if answer.upper() == name:
            print("Voila !! YOU HAVE LEARNT THE CHARACTER WELL !!!")
            r = r + 1
        else:
            print("Sorry , Learn the Symbol again")
            w = w + 1
        continue
    print(style.RED + "--------------")
    print(" TEST RESULTS ")
    print("--------------")
    print("CORRECT ANSWERS :", r)
    print("INCORRECT ANSWERS : " + style.RESET, w)


def random_test_greek_alphabets_lower():
    r = 0
    w = 0
    for k, v in greek_alphabets_lower.items():

        letter , name = random.choice(list(greek_alphabets_lower.items()))
        print("Recognize this letter" , letter)
        answer = input(" Enter Your answer: ")

        if answer.upper() == name:
            print("Voila !! YOU HAVE LEARNT THE CHARACTER WELL !!!")
            r = r + 1
        else:
            print("Sorry , Learn the Symbol again")
            w = w + 1
        continue
    print(style.RED + "--------------")
    print(" TEST RESULTS ")
    print("--------------")
    print("CORRECT ANSWERS :", r)
    print("INCORRECT ANSWERS : " + style.RESET, w)

# THIS IS THE BODY OF THE MAIN PROGRAM WHICH PERFORMS 4 FUNCTIONS VIZ LEARNING ( UPPER AND LOWER )
# TESTING (RANDOM AND SEQUENTIAL)
i = 0
while i == 0:
    print(style.CYAN +" EMBARKING ON GREEK ALPHABET LEARNING JOURNEY")

    userinput1 = input(" Do you wish to learn alphabets (l) or test your skills (t) or quit (q) : " + style.RESET)
    if userinput1.lower() == "l":
        userinput2 = input(" Greek Alphabets has 2 Sets. Do you wish to learn Capitals (C) or Lower (L) or Quit (Q) : ")
        if userinput2.lower() == "c":
            learn_greek_alphabets_upper()
        elif userinput2.lower() == "l":
            learn_greek_alphabets_lower()
        elif userinput2.lower() == "q":
            print(" Thank YOU for using the program !! Have a Nice Day !!")
            break

        else:
            print("Please Select a Valid Option")



    elif userinput1.lower() == "q":
        print(" Thank YOU for using the program !! Have a Nice Day !!")
        break

    elif userinput1.lower() == "t":
        userinput5 = input(" Do You Wish to take Test of Capital Letters  (C) or Small Letters (L) or Quit (Q) : ")
        if userinput5.lower() == "c":
            testchoice1 = input("RANDOM Letters (R) or SEQUENTIAL Letters (S) or QUIT (Q) : ")
            if testchoice1.lower() == "r":
                random_test_greek_alphabets_upper()
            elif testchoice1.lower() == "s":
                test_greek_alphabets_upper()
            elif testchoice1.lower() == "q":
                print(" Thank YOU for using the program !! Have a Nice Day !!")
                break
            else:
                print("Please Select a Valid Option")
        elif userinput5.lower() == "l":
            testchoice2 = input("RANDOM Letters (R) or SEQUENTIAL Letters (S) or QUIT (Q) : ")
            if testchoice2.lower() == "r":
                random_test_greek_alphabets_lower()
            elif testchoice2.lower() == "s":
                test_greek_alphabets_lower()
            elif testchoice2.lower() == "q":
                print(" Thank YOU for using the program !! Have a Nice Day !!")
                break
            else:
                print("Please Select a Valid Option")
        elif userinput5.lower() == "q":
            print(" Thank YOU for using the program !! Have a Nice Day !!")
            break
        else:
            print("Please Select a Valid Option")

    else:
        print("Please Select a Valid Option")

Easy Python Program for Kids Complex Number Converter Free Code

import math
print("""
WELCOME TO COMPLEX NUMBER CALCULATOR
This program converts a rectangular coordinate system complex number to polar coordinate system complex number;
and vice- versa.
This is a free program and can be used and redistributed without any attribution.
""")
i = 0
while i == 0:
    c = input(" Please Enter the Coordinate System you want to convert : [R] for Rectangular, [P] for Polar or [Q] to quit the program: ")
    if (c.lower() == 'r'):
        a = int(input("Enter the Real Part (a) :"))
        b = int(input("Enter the imaginary Part (b) :"))
        print("YOU HAVE ENTERED Z = " , a , "+ i " , b)
        r = ((a*a) + (b*b))
        R = math.sqrt(r)
        angle = math.atan(b/a)
        print("Z in Polar Coordinate Format is : " , R , "\u2220 " , angle , "\u00b0")

    elif (c.lower() == 'p'):
        r = int(input("Enter the Magnitude(r) :"))
        theta = int(input("Enter the Angle Theta(\u03F4) :"))
        print("YOU HAVE ENTERED Z = ", r, "\u2220 ", theta , "\u00b0")
        u = r * math.cos(theta)
        v = r * math.sin(theta)
        print(" Z in Rectangular Coordinate Format is : " , u , " + i", v)
    elif (c.lower() == 'q'):
        print("THANK YOU AGAIN FOR USING THE PROGRAM ! GOOD BYE")
        break
    else:
        print("Enter Sensible Value")




Easy Python Program for Kids Plant a Virtual Tree | Free Code

tree = input("How Big a Tree Do You Want to Plant (Enter BIG , MEDIUM , SMALL : ")
if(tree.lower() == 'big'):
    i = 41
elif(tree.lower() == 'medium'):
    i = 25
elif(tree.lower() == 'small'):
    i=15
else:
    print("Enter a Valid SIZE")
    i = 0
stem_width = i
j = 0
while(i >=0 and j <= i):
    print(' ' * i , 2*('*' * j) , ' '* i)
    i = i - 1
    j = j + 1
n = stem_width
m = int((2 * n) + 2 )
q = int(m/5)
stem_length = int(j/3)

for stem in range(stem_length):
    print(' ' * (2 *q), ('|' * q), ' ' * (2 *q))
print(" ")
print("Thank You Planting a" , "--" , tree.upper() , "TREE --")

A Compendium of Epigrams Vol:1

Buy From Amazon  Kindle Edition Sneak Peak of Second BOOK