Posts

#6a: Codding In C++ {FACTORIAL FINDER}

Image
#include <iostream.h> int main() { int a,b,c,d; cout<<"Enter number: "; cin>>c; a=1; b=2; for(int i=1;i<c;i++) { d=a*b; a=d; b=b+1; } cout<<c<<" ! = "<<d; return 0; } For PYTHON codes for same CLICK HERE. Download CODES HERE

#4s: Codding in Python {TIC TAK TOE USING TURTLE}

Image
import turtle as t t.setup(350,410) def grid(): t.speed(0) t.fd(200) t.fd(-300) t.fd(100) t.right(-90) t.fd(100) t.bk(300) t.fd(100) t.right(90) t.fd(200) t.fd(-300) t.fd(200) t.right(-90) t.fd(200) t.fd(-300) def rules(): t.pu() t.goto(-155,170) t.pd() t.write('For X use left mouse button, for O use right mouse button.',font=('Arial',9)) t.pu() t.goto(-155,155) t.pd() t.write('X will start first, kindly do not cheat',font=('Arial',9)) rules() t.pu() t.goto(-50,50) t.pd() grid() p1=[] p2=[] def writo(q,w,a,f): print('Player 2 wins') t.pd() t.speed(0) t.pensize(5) t.color('Red') t.pu() t.goto(q,w) t.pd() t.seth(a) t.speed(1) t.fd(f) ...

#4r: Codding in Python {DAY FINDER}

Image
#Note: Logic for this code was from my Mental Ability classes in my coaching center. for j in range(1):     print('Only for 4-digit year')     date=int(input('Enter date: '))     month=str(input('Enter full name of month in CAPS ON: '))     year=int(input('Enter 4-digit year: '))     k=[]     if date<=31:         if month=='JANUARY' or month=='FEBRUARY' or month=='MARCH' or month=='APRIL' or month=='MAY' or month=='JUNE' or month=='JULY' or month=='AUGUST' or month=='SEPTEMBER' or month=='OCTOBER' or month=='NOVEMBER' or month=='DECEMBER':             aa=year             for i in range(0,aa+1,4):                 k.append(i)             for t in (k):                 if t%100==0 and t%400!=0:     ...

#4q: Codding in Python {1-Player : HAND CRICKET}

Image
import random as r hits=[1,1,2,3,3,3,4,4,4,5,5,5,6,6,6,6]      toss=['HEADS','TAILS'] toss1=str(input('Enter HEADS or TAILS: ')) toss2=r.choice(toss) if toss1==toss2:     print('You won the toss!')     bb=input('BAT or BALL first: ')     if bb=='BAT':         print()         print()         print('You are batting first.')         wickets=int(input('Enter number of Wickets: '))                  wic=0         runs=[]         while wickets>wic:                                       run=sum(runs)             qwert=[run,'/',wic]             for tttt in (qwert):           ...