Program to find Smallest K digit number divisible by X

 def answer(X, K):

MIN = pow(10, K-1)

if(MIN%X == 0):

return (MIN)

else:

return ((MIN + X) - ((MIN + X) % X))

X = 83;

K = 5;

print(answer(X, K));


BMI Calculator Using Python

height = float(input("Enter height in foot"))

height_in_meter = height*12/39.37

weight = int(input("Enter weight in kg"))

BMI = weight/pow(height_in_meter,2)

print("BMI:-",BMI)

if BMI > 25:

print("Overweight")

elif BMI < 18:

print("Underweight")

else:

print("Fit")

Python script that takes the city name and returns the weather information of that city using web scraping

from bs4 import BeautifulSoup

import requests

headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'}

def weather(city):

    city=city.replace(" ","+")

    res = requests.get(f'https://www.google.com/search?q={city}&oq={city}&aqs=chrome.0.35i39l2j0l4j46j69i60.6128j1j7&sourceid=chrome&ie=UTF-8',headers=headers)

    print("Searching in google......\n")

    soup = BeautifulSoup(res.text,'html.parser')   

    location = soup.select('#wob_loc')[0].getText().strip()  

    time = soup.select('#wob_dts')[0].getText().strip()       

    info = soup.select('#wob_dc')[0].getText().strip() 

    weather = soup.select('#wob_tm')[0].getText().strip()

    print(location)

    print(time)

    print(info)

    print(weather+"°F") 

print("enter the city name")

city=input()

city=city+" weather"

weather(city)

Create Graph Using Python

import matplotlib.pyplot as plt

import numpy as np

xpoints = np.array([1,8])

ypoints = np.array([3,10])

plt.plot(xpoints,ypoints)

plt.show()

Drawing Corona Virus Using Turtle

from turtle import *

color('green')

bgcolor('black')

speed(10)

hideturtle()

b = 0

while b < 200:

right( b)

forward(b * 3)

b = b + 1