Posts

Showing posts with the label CODING

Automating Piano Tiles in Python Which is Damn easy!!!!!!!!

Image
Piano Tiles is the most amazing game that we have played in our free time. I hope that you have also heard it and played also. So, I woke up today and thought that I should play a game and while playing the game I thought that why should not I automate it so I did. So I code this script and tried it and it is working very well. And this script is experimented on lagged.com which has a lot of games on their website and yes one more thing you can see my name on the leader boards now with the name 'Ak' Leaderboards: And yes I scored less because I can not wait anymore to make more games automated with python. The conclusion is yes it is fun coding this program. I hope you all will code also. T o make it run in your pc: Step1: first install the python and paste the script in your computer or system you have. Step2: get the positions of first, second, third and fourth grid iof the game, that where it is visible on your system's monitor. Step3: run the script and switch to browse...

PALINDROMES IN PYTHON

Image
 

CALCULATING ARMSTRONG NUMBER IN PYTHON LANGUAGE

Code:-   while   True :      """ 128649     1^6+2^6+8^6+6^6....      """     a  =   input ( " FIRST LET ME KNOW THE NUMBER WHAT IS IT? :  " )     power  =   len ( a )     li  =   []      if  a  ==   " quit " . lower ():          quit ()      #print(power)      for  i  in  a :         e  =   int ( i ) ** power         li . append ( e )      #print(li)      #print(sum(li))      if   sum ( li )   ==   int ( a ):          print ( f " { a }  is an...

MY FIRST MYSQL PROJECT I EVER MADE

 FIRST FILE CODE: import  mysql . connector  as  connector ab  =   0 asking  =   int ( input ( " How many numbers you actually want to add:  " )) if  asking  ==   0 :      pass      quit () else:      while  ab  <  asking :         asking  -=   1         name  =   input ( " Enter The name you want to add:  " )         number  =   int ( input ( " Enter the number you want to add:  " ))         a  =  connector . Connect ( host = " localhost " ,   user   =   " root " ,                  passw...

MAKING QRCODES IN PYTHON LANGUAGE OR PYTHON 3 LANGUAGE(AND YOU CAN SCAN THIS QR CODE [THE GIVEN IMAGE ON THIS BLOG])

Image
  import  qrcode  as  qr link  =   """ https://www.youtube.com/channel/UCzEHu0LH3QCT0YAYE_LH0wQ?view_as=subscriber """ a  =  qr . make ( link ) a . save ( " youtube special.png " , " PNG " )

PYTHON OR PYTHON 3 PROGRAM FOR GAME STONE, PAPER, SCISSOR

Image
  import  random choices  =   [ " stone " ,   " scissor " ,   " paper " ] computer_choice  =  random . choice ( choices ) coputer_score  =   0 player_score  =   0 while   True :     player_choice  =   input ( " Enter Your choice from stone, paper, scissor:  " )           if  computer_choice  ==  player_choice . lower ():          print ( " It is a draw here " )          pass      elif  computer_choice  ==   " stone "   and  player_choice . lower ()   ==   " paper " :         player_score  +=   1          print ( " Here Player Wins!!! " )   ...

Reversing A String In Python Language Or Python 3

Image
#Stringrev.py #Here we Use The Indexes in reversing  a string and the code will be: def   reverse ( a ):      return  (a[::- 1 ]) print (reverse( "Your String" )) # Here I used A function To Make It Easy

NUMBER GUESSING GAME CODE FOR BEGINNERS

import  random print ( "Here You Have To Guess The Numbers From 0-10" ) print ( "If You Got right You will Get a Point" ) print ( "if you want to exit type 12" ) score =  0 while   True :     number =  int ( input ( "Enter The Number You Guessed Here: " ))     a = random.randrange( 10 )      if  number == a:         score = score+ 1          print ( "miracle You Got Right Answer." )      elif  number ==  None :          pass      elif  number ==  12 :          print ( f"Here i...

CALCULATING FACTORIALS IN PYTHON LANGUAGE

n  =   int ( input ( " Enter Here You Want to calculate the factorial:  " )) x  =   1 for  i  in   range ( 1 , n + 1 ):     x  *=  i print ( x ) """ FACTORIAL EXAMPLE: 1! = 1 2! = 2*1 = 2 3! = 3*2*1 = 6 4! = 4*3*2*1 = 24 5! = 5*4*3*2*1 = 120 """

PROGRAM TO CONVERT 12HOURS CLOCK TIME INTO 24HOURS CLOCK

  def  timeConversion(s):     if  s[ 0 : 2 ] ==  "12"   and  s[- 2 :] ==  "AM" :         print( "00" +s[ 2 : 8 ])      elif  s ==  "12:00:00AM" :         print( "00:00:00" )      elif  s[ 0 : 2 ] ==  "12"   and  s[ 7 : 9 ] ==  "PM" :         print(s[ 0 : 7 ])      elif  s[- 2 :] ==  "PM"   and  s[ 0 : 2 ] !=  "12" :         print( f " {int(s[: 2 ])+ 12 }{s[ 2 : 8 ]} " )      elif  s[ 0 : 2 ] ==  "24" :         print( "THIS TIME IS ALREADY AS 24 HOURS CLOCK" )      else :      ...

MY LIFE'S FIRST GAME I CREATED

Image
IF SOMEONE LIKES THIS CODE PLEASE COMMENT BELOW ABOUT YOUR FEEDBACK......... import pygame import random import math from pygame import mixer pygame.init() # screen management size = ( 800 , 600 ) screen = pygame.display.set_mode(size) #game title pygame.display.set_caption( 'OCTA SHOOT' ) #icon title a = pygame.image.load( 'octa.png' ) pygame.display.set_icon(a) #player playerimg = pygame.image.load( 'octopus4.png' ) playerx = 370 playery = 480 playerx_change = 0 #enemy enemyimg = [] enemyx = [] enemyy = [] enemyx_change = [] enemyy_change = [] num_of_enemies = 6 for i in range (num_of_enemies): enemyimg.append(pygame.image.load( 'enemy.png' )) enemyx.append(random.randint( 0 , 798 )) enemyy.append(random.randint( 50 , 150 )) enemyx_change.append( 1 ) enemyy_change.append( 40 ) # bullet bulletimg = pygame.image.load( 'sun.png' ) bulletx = 0 bullety = 480 bulletx_change = 0 bullety_change = 2 bullet_state = "ready" #...

PROGRAM TO AUTOMATE YOUR PC WITH PYTHON TO OPEN DOODLE CRICKET

import  pyautogui import  time import  keyboard import  os os.chdir( "E:/Program Files (x86)/AVAST Software/Browser/Application" )  #(directory where you saved your browser.) os.system( "AvastBrowser.exe" ) # YOUR BROWSER NAME time.sleep( 2 ) pyautogui.typewrite( "https://doodlecricket.github.io/#/" ) while   True :      if  keyboard.is_pressed( 'q' ):          quit ()     pyautogui.press( "enter" )

READ CHARACTERS IN USER INPUT WITH DICTIONARY

a =  input ( "Enter Some Characters Here: " ) lol = {} for  j  in  a:     t = lol.get(j)      if  t ==  None :         lol.setdefault(j,  1 )      else :         t +=  1         lol. __setitem__ (j, t) print (lol)

A SIMPLE GAME FOR A BEGINNER IN PYTHON WITH ONLY TWO MODULES

import time import playsound playsound.PlaysoundException( "HERE YOU CAN PLAY YOUR FAV SONG IF YOU HAVE THAT ON SAME                                         DIRECTORY" ) op = input ( "Do You Want To Play This Game: " ) if op in [ "Yes" , "yes" ]: print ( "ok let's start Now This Game is a QUESTIONING GAME AND YOU HAVE TO ANSWER..." ) elif op in [ "No" , "no" ]: exit () else : print ( """I AM CLOSING this game AND you will have to pay $1Google plex""" ) exit () print ( """-----------------------------------------------------------------------------------           ------------------------------""" ) print ( """ Hello welcome to my game           """ ) time.sleep( 3 ) print ( """ In this game you have to solv...