Posts

Showing posts from October, 2020

PALINDROMES IN PYTHON

Image
 

CALCULATING ARMSTRONG NUMBERS EASY TO CALCULATE AND UNDERSTANDABLE

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 armstrong number." )      else:          print ( f " { a }  is not an armstrong number." ) 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

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 " ,                  password   =   " 9.8.9.9.6.7.7.4.1.1. " )         cur  =  a . cursor ()          #cur.execute("show databases")          #results = cur.fetchall()          #cur.execute("create database telephone_directory")         cur . execute ( " use telephone_directory " )          #cur.execute("create table telephone_directory(name char(200),            #       numbers bigint(12))")         cur . execute ( f "in

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!!! " )      elif  computer_choice  ==   " stone "   and  player_choice . lower ()   ==   " scissor " :         coputer_score  +=   1          print ( " Here Computer Wins!!! " )      elif  computer_choice  ==   " paper "   and  player_choice . lower ()   ==   " stone " :         coputer_score  +=   1          print ( " Here Co