Skip to main content

Posts

Showing posts with the label Python Tutorials [code_with_yash]

HackerRank Tuples Solution in Python

  HackerRank Tuples Solution in Python Task Given an integer,n, and n  space-separated integers as input, create a tuple, t, of those n integers. Then compute and print the result of hash(t). Note:   hash()  is one of the functions in the  __builtins__  module, so it need not be imported. Input Format The first line contains an integer,n, denoting the number of elements in the tuple. The second line contains n space-separated integers describing the elements in tuple t . Output Format Print the result of  hash(t) . Sample Input 0 2 1 2 Sample OUTPUT- 3713081631934410656 n = int(input()) int_list = [int(i) for i in input().split()] int_tuple = tuple(int_list) print(hash(int_tuple))

Python YouTube Downloader with Pytube

  Python YouTube Downloader with Pytube:- Python YouTube Video Downloader  is an application to download videos from YouTube. This provides users to download videos they need in their devices and watch them offline. Youtube Video Downloader Python Project The Youtube downloader project is a python project. The object of this project is to download any type of video in a fast and easy way from youtube in your device. In this python project, the user has to copy the youtube video URL that they want to download and simply paste that URL in the ‘paste link here’ section and click on the download button, it will start downloading the video. When video downloading finishes, it shows a message ‘downloaded’ popup on the window below the download button. Steps to Develop Python YouTube Downloader Project Prerequisites To implement this project we use the basic concept of python, Tkinter, pytube library. Tkinter  is a standard GUI library and it is one of the easiest ways to build ...

How to Calculating the area of circle using Python

  How to Calculating the area of a circle using Python:- The area of the circle is the number of square units inside the circle, can be calculated using the radius and diameter. The formula for evaluating the area of a circle is Area of circle using radius=     Pi*r*r     ( r is the radius of the circle) Area of the circle using diameter=    1/4*Pi*d*d   ( d is the diameter of the circle) Pi is a Greek letter and the value of Pi is equal to 3.14159265359. In the program, we will be initiating Pi as a global variable or we can simply import from the math module present in python. The syntax for importing pi from math module:   from import math. ALGORITHMS:- 1 .Input radius/diameter.     2 . Calculate the area of a circle using the formula.              area= pi*r*r(if radius is given as input).            ...