Skip to main content

Posts

Showing posts from November, 2020

YouTube Downloader

CODE  IS BELOW: 1st You Need To Install Pytube ! For that you need to run the command pip install pytube After Installing Pytube From Above , You are good to go ! from pytube import YouTube link = input("Enter the video link : ") print("Downloading.../") YouTube(link).streams.first().download() print("Download Successful! Check This Folder For Downloaded Video C/Users/YOUR_USER_NAME")

World Clock

CODE FOR THIS  IS BELOW: Here, in this post, we will see how can we Get Any Country Date And Time Using Python which will be something like a World clock using Python. For this, we need the datetime module and python’s timezone module i.e.  pytz . To install pytz python, type the below command in your terminal– pip install pytz We can print the names of all countries whose timezone is available using this module using the following code– from datetime import datetime import pytz # list of desired countries Country_Zones = ['America/New_York', 'Asia/Kolkata', 'Australia/Sydney', 'Canada/Atlantic', 'Brazil/East','Chile/EasterIsland', 'Cuba', 'Egypt', 'Europe/Amsterdam', 'Europe/Athens', 'EuropeBerlin', 'Europe/Istanbul', 'Europe/Jersey', 'Europe/London', 'Europe/Moscow', 'Europe/Paris', 'Europ...

Tic Tac Toe

CODE IS BELOW: Do Follow Our Instagram Page  & Share To Your Friends! board = [' ' for x in range(10)] def insertLetter(letter, pos): board[pos] = letter def spaceIsFree(pos): return board[pos] == " " def printBoard(board): print(" " + board[1] + "| " + board[2] + "| " + board[3]) print("---------") print(" " + board[4] + "| " + board[5] + "| " + board[6]) print("---------") print(" " + board[7] + "| " + board[8] + "| " + board[9]) def isWinner(bo, le): return ((bo[7] == le and bo[8] == le and bo[9] == le) or (bo[4] == le and bo[5] == le and bo[6] == le) or (bo[1] == le and bo[2] == le and bo[3] == le) or (bo[1] == le and bo[4] == le and bo[7] == le) or (bo[2] == le and bo[5] == le and bo[8] == le) or (bo[3] == le and bo[6] == le and bo[9] == le) or ...

PIKACHU

CODE FOR DRAWING THIS PIKACHU IS BELOW: import turtle def getPosition(x, y): turtle.setx(x) turtle.sety(y) print(x, y) class Pikachu: def __init__(self): self.t = turtle.Turtle() t = self.t t.pensize(3) t.speed(9) t.ondrag(getPosition) def noTrace_goto(self, x, y): self.t.penup() self.t.goto(x, y) self.t.pendown() def leftEye(self, x, y): self.noTrace_goto(x, y) t = self.t t.seth(0) t.fillcolor('#333333') t.begin_fill() t.circle(22) t.end_fill() self.noTrace_goto(x, y+10) t.fillcolor('#000000') t.begin_fill() t.circle(10) t.end_fill() self.noTrace_goto(x+6, y + 22) t.fillcolor('#ffffff') t.begin_fill() t.circle(10) t.end_fill() def rightEye(self, x, y): self.noTrace_goto(x, y) t = self.t ...

Drawing A Design In Python

 Code :  from turtle import *  from random import randint  bgcolor('black')  x = 1  speed(0)  while x < 400:      r = randint(0,255)   g = randint(0,255)    b = randint(0,255)      colormode(255)    pencolor(r,g,b)   fd(50 + x)   rt(90.991)   x = x+1     exitonclick() Result : 

Drawing Doraemon

CODE:  from turtle import * def my_goto(x, y): penup() goto(x, y) pendown() def eyes(): fillcolor("#ffffff") begin_fill() tracer(False) a = 2.5 for i in range(120): if 0 <= i < 30 or 60 <= i < 90: a -= 0.05 lt(3) fd(a) else: a += 0.05 lt(3) fd(a) tracer(True) end_fill() def beard(): my_goto(-32, 135) seth(165) fd(60) my_goto(-32, 125) seth(180) fd(60) my_goto(-32, 115) seth(193) fd(60) my_goto(37, 135) seth(15) fd(60) my_goto(37, 125) seth(0) fd(60) my_goto(37, 115) seth(-13) fd(60) def mouth(): my_goto(5, 148) seth(270) fd(100) seth(0) circle(120, 50) seth(230) circle(-120, 100) def scarf(): fillcolor('#e70010') begin_fill() seth(0) fd(200) circle(-5, 90) fd(10) circle(-5, 90) fd(20...

INSTALLING PYTHON (Anaconda)

 IN WINDOWS :  Download the Anaconda installer (TIP : IF IMAGES ARE BLURRED , TAP ON THEM FOR FULL SCREEN IMAGE) 1] Click the link the download will be started! 2]  Double click the downl oaded file to launch. 3] Click NEXT 4]  Read the licensing terms and click “I Agree”. 5] Select an install for “Just Me” 6] Select a destination folder to install Anaconda and click the Next button   7] Choose whether to add Anaconda to your PATH environment variable. We recommend not adding Anaconda to the PATH environment variable, since this can interfere with other software. Instead, use Anaconda software by opening Anaconda Navigator or the Anaconda Prompt from the Start Menu. 8] Choose whether to register Anaconda as your default Python. Unless you plan on installing and running multiple versions of Anaconda or multiple versions of Python, accept the default and leave this box checked 9] Click the Install button. If you want to watch the packages Anaconda is installing, c...

AMONG US

 HERE IS THE CODE TO DRAW AMONG US! import turtle BODY_COLOR = 'red' BODY_SHADOW = '' GLASS_COLOR = '#9acedc' GLASS_SHADOW = '' s = turtle.getscreen() t = turtle.Turtle() # it can move forward backward left right def body(): """ draws the body """ t.pensize(20) #t.speed(15) t.fillcolor( BODY_COLOR ) t.begin_fill() # right side t.right(90) t.forward(50) t.right(180) t.circle(40, -180) t.right(180) t.forward(200) # head curve t.right(180) t.circle(100, -180) # left side t.backward(20) t.left(15) t.circle(500, -20) t.backward(20) #t.backward(200) t.circle(40, -180) #t.right(90) t.left(7) t.backward(50) # hip t.up() t.left(90) t.forward(10) t.right(90) t.down() #t.right(180) #t.circle(25, -180) t.right(240) t.circle(50, -70) t.end_fill() def glass(): t.up() #t.right(180) t....

Url Shortener Project Using Python

  What you need Basics of python knowledge on Dictionary and functions knowledge on Classes and objects.        OK!! HERE IS THE CODE 😊                 import random import string     def create_shortURL(link):             chars = string.ascii_lowercase      # chars = ['a','c','z']      short_url = ''.join(random.choice(chars) for i in range ( 5 ))      d = {}      URL = 'https://www.plc.ly/' + short_url # PLC = Python Learn Camp             d[URL] = link            # This is optional        if URL in d:          print ( 'Your URL:' ,d[URL])          print ( 'Shorten URL:' ,URL) ...