From 8db05aae3dfb3f840f2a095225055c785642fdc0 Mon Sep 17 00:00:00 2001 From: mr-d-luffy Date: Wed, 3 Dec 2025 00:11:07 +0530 Subject: [PATCH 1/4] commets --- youtubedownloader.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/youtubedownloader.py b/youtubedownloader.py index 80362a737f3..6f526373870 100644 --- a/youtubedownloader.py +++ b/youtubedownloader.py @@ -1,10 +1,14 @@ from tkinter import Button, Entry, Label, Tk, filedialog, messagebox from threading import Thread from pytube import YouTube + +# this function for mulple code runes at a time def threading(): # Call work function t1 = Thread(target=download) t1.start() + +# this function for Download Youtube video def download(): try: url = YouTube(str(url_box.get())) From 2100a3abcbdce9472a825d7a1204c08c1382997c Mon Sep 17 00:00:00 2001 From: mr-d-luffy Date: Wed, 3 Dec 2025 00:28:46 +0530 Subject: [PATCH 2/4] added Some commets and new error massage, changed font color in label top of the Entry box becouse they cont visible in white color, i changed into black color. --- youtubedownloader.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/youtubedownloader.py b/youtubedownloader.py index 6f526373870..67fe8d3db90 100644 --- a/youtubedownloader.py +++ b/youtubedownloader.py @@ -1,6 +1,7 @@ -from tkinter import Button, Entry, Label, Tk, filedialog, messagebox -from threading import Thread -from pytube import YouTube +# modules for Using of app +from tkinter import Button, Entry, Label, Tk, filedialog, messagebox # Gui Modules +from threading import Thread # modules for multi threding +from pytube import YouTube # Module for Youtube service # this function for mulple code runes at a time def threading(): @@ -22,7 +23,7 @@ def download(): else: messagebox.showwarning("", "Download cancelled!") except Exception: - messagebox.showerror("Error", "An error occurred while downloading the video.") + messagebox.showerror("Error", "Some Thing Went Wrong!!!\nplease try again") # This code runes on only this file @@ -44,13 +45,14 @@ def download(): ) introlable.place(x=35, y=20) - Label(root, text="Enter YouTube Link", font=("sans-serif", 16), bg="olivedrab1").place( + Label(root, text="Enter YouTube Link", font=("sans-serif", 16), bg="olivedrab1", fg='Black').place( x=40, y=150 ) url_box = Entry(root, font=("arial", 30), width=30) url_box.place(x=40, y=180) + # download button in UI btn = Button(root, text="DOWNLOAD", font=("sans-serif", 25), command=threading) btn.place(x=270, y=240) root.mainloop() From 13968e67888f2eb8448e995786788bc790c59ddf Mon Sep 17 00:00:00 2001 From: mr-d-luffy Date: Wed, 3 Dec 2025 00:33:01 +0530 Subject: [PATCH 3/4] all clear --- youtubedownloader.py | 1 + 1 file changed, 1 insertion(+) diff --git a/youtubedownloader.py b/youtubedownloader.py index 67fe8d3db90..b4b813e7b5e 100644 --- a/youtubedownloader.py +++ b/youtubedownloader.py @@ -49,6 +49,7 @@ def download(): x=40, y=150 ) + # entry box in UI url_box = Entry(root, font=("arial", 30), width=30) url_box.place(x=40, y=180) From be7fa3eacec1d4f7116672e2c2a20cbf8450762e Mon Sep 17 00:00:00 2001 From: Vedika Agarwal Date: Wed, 3 Dec 2025 20:14:45 +0530 Subject: [PATCH 4/4] updated sum_of_digits_of_a_number to include negative numbers --- sum_of_digits_of_a_number.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sum_of_digits_of_a_number.py b/sum_of_digits_of_a_number.py index 64d62b281b7..f17fd6bcf41 100644 --- a/sum_of_digits_of_a_number.py +++ b/sum_of_digits_of_a_number.py @@ -13,6 +13,8 @@ 0 >>> sum_of_digits(999) 27 + >>> sum_of_digits(-123) + 6 """ import sys @@ -49,8 +51,8 @@ def sum_of_digits(n: int) -> int: Compute the sum of the digits of an integer. Args: - n:Non-negative integer - If the integer is negative , it is converted to postive interger and assigned to same number + n: Non-negative integer. + If the integer is negative, it is converted to positive before computing the sum. Returns: Sum of digits of the number. @@ -60,8 +62,10 @@ def sum_of_digits(n: int) -> int: 6 >>> sum_of_digits(405) 9 + >>> sum_of_digits(-789) + 24 """ - n=abs(n) + n = abs(n) # FIX: handle negative numbers total = 0 while n > 0: # Add last digit and remove it from n