diff --git a/Automated Scheduled Call Reminders/caller.py b/Automated_Scheduled_Call_Reminders/caller.py similarity index 100% rename from Automated Scheduled Call Reminders/caller.py rename to Automated_Scheduled_Call_Reminders/caller.py diff --git a/Automated Scheduled Call Reminders/requirements.txt b/Automated_Scheduled_Call_Reminders/requirements.txt similarity index 100% rename from Automated Scheduled Call Reminders/requirements.txt rename to Automated_Scheduled_Call_Reminders/requirements.txt diff --git a/Automated Scheduled Call Reminders/schedular.py b/Automated_Scheduled_Call_Reminders/schedular.py similarity index 100% rename from Automated Scheduled Call Reminders/schedular.py rename to Automated_Scheduled_Call_Reminders/schedular.py diff --git a/Collatz Sequence/Collatz Sequence.py b/Collatz_Sequence/Collatz Sequence.py similarity index 100% rename from Collatz Sequence/Collatz Sequence.py rename to Collatz_Sequence/Collatz Sequence.py diff --git a/email id dictionary/README.md b/Email_ID_Dictionary/README.md similarity index 100% rename from email id dictionary/README.md rename to Email_ID_Dictionary/README.md diff --git a/email id dictionary/dict1.py b/Email_ID_Dictionary/dict1.py similarity index 100% rename from email id dictionary/dict1.py rename to Email_ID_Dictionary/dict1.py diff --git a/email id dictionary/mbox-short.txt b/Email_ID_Dictionary/mbox-short.txt similarity index 100% rename from email id dictionary/mbox-short.txt rename to Email_ID_Dictionary/mbox-short.txt diff --git a/Face and eye Recognition/face_recofnation_first.py b/Face_And_Eye_Recognition/face_recofnation_first.py similarity index 100% rename from Face and eye Recognition/face_recofnation_first.py rename to Face_And_Eye_Recognition/face_recofnation_first.py diff --git a/Face and eye Recognition/gesture_control.py b/Face_And_Eye_Recognition/gesture_control.py similarity index 100% rename from Face and eye Recognition/gesture_control.py rename to Face_And_Eye_Recognition/gesture_control.py diff --git a/1 File handle/File handle binary/.env b/File_Handling/File handle binary/.env similarity index 100% rename from 1 File handle/File handle binary/.env rename to File_Handling/File handle binary/.env diff --git a/1 File handle/File handle binary/Update a binary file2.py b/File_Handling/File handle binary/Update a binary file2.py similarity index 96% rename from 1 File handle/File handle binary/Update a binary file2.py rename to File_Handling/File handle binary/Update a binary file2.py index d256c7c805b..9e9207be2de 100644 --- a/1 File handle/File handle binary/Update a binary file2.py +++ b/File_Handling/File handle binary/Update a binary file2.py @@ -1,33 +1,33 @@ -# updating records in a binary file - -import pickle - - -def update(): - with open("studrec.dat", "rb+") as File: - value = pickle.load(File) - found = False - roll = int(input("Enter the roll number of the record")) - - for i in value: - if roll == i[0]: - print(f"current name {i[1]}") - print(f"current marks {i[2]}") - i[1] = input("Enter the new name") - i[2] = int(input("Enter the new marks")) - found = True - - if not found: - print("Record not found") - - else: - pickle.dump(value, File) - File.seek(0) - print(pickle.load(File)) - - -update() - -# ! Instead of AB use WB? -# ! It may have memory limits while updating large files but it would be good -# ! Few lakhs records would be fine and wouln't create any much of a significant issues +# updating records in a binary file + +import pickle + + +def update(): + with open("studrec.dat", "rb+") as File: + value = pickle.load(File) + found = False + roll = int(input("Enter the roll number of the record")) + + for i in value: + if roll == i[0]: + print(f"current name {i[1]}") + print(f"current marks {i[2]}") + i[1] = input("Enter the new name") + i[2] = int(input("Enter the new marks")) + found = True + + if not found: + print("Record not found") + + else: + pickle.dump(value, File) + File.seek(0) + print(pickle.load(File)) + + +update() + +# ! Instead of AB use WB? +# ! It may have memory limits while updating large files but it would be good +# ! Few lakhs records would be fine and wouln't create any much of a significant issues diff --git a/1 File handle/File handle binary/delete.py b/File_Handling/File handle binary/delete.py similarity index 100% rename from 1 File handle/File handle binary/delete.py rename to File_Handling/File handle binary/delete.py diff --git a/1 File handle/File handle binary/question 1 (elegible for remedial, top marks).py b/File_Handling/File handle binary/question 1 (elegible for remedial, top marks).py similarity index 96% rename from 1 File handle/File handle binary/question 1 (elegible for remedial, top marks).py rename to File_Handling/File handle binary/question 1 (elegible for remedial, top marks).py index 8b6d120cbf7..27a29f887dc 100644 --- a/1 File handle/File handle binary/question 1 (elegible for remedial, top marks).py +++ b/File_Handling/File handle binary/question 1 (elegible for remedial, top marks).py @@ -1,66 +1,66 @@ -"""Amit is a monitor of class XII-A and he stored the record of all -the students of his class in a file named “student_records.pkl”. -Structure of record is [roll number, name, percentage]. His computer -teacher has assigned the following duty to Amit - -Write a function remcount( ) to count the number of students who need - remedial class (student who scored less than 40 percent) -and find the top students of the class. - -We have to find weak students and bright students. -""" - -## Find bright students and weak students - -from dotenv import load_dotenv -import os - -base = os.path.dirname(__file__) -load_dotenv(os.path.join(base, ".env")) -student_record = os.getenv("STUDENTS_RECORD_FILE") - -import pickle -import logging - -# Define logger with info -# import polar - - -## ! Unoptimised rehne de abhi ke liye - - -def remcount(): - with open(student_record, "rb") as F: - val = pickle.load(F) - count = 0 - weak_students = [] - - for student in val: - if student[2] <= 40: - print(f"{student} eligible for remedial") - weak_students.append(student) - count += 1 - print(f"the total number of weak students are {count}") - print(f"The weak students are {weak_students}") - - # ! highest marks is the key here first marks - - -def firstmark(): - with open(student_record, "rb") as F: - val = pickle.load(F) - count = 0 - main = [i[2] for i in val] - - top = max(main) - print(top, "is the first mark") - - for i in val: - if top == i[2]: - print(f"{i}\ncongrats") - count += 1 - print("The total number of students who secured top marks are", count) - - -remcount() -firstmark() +"""Amit is a monitor of class XII-A and he stored the record of all +the students of his class in a file named “student_records.pkl”. +Structure of record is [roll number, name, percentage]. His computer +teacher has assigned the following duty to Amit + +Write a function remcount( ) to count the number of students who need + remedial class (student who scored less than 40 percent) +and find the top students of the class. + +We have to find weak students and bright students. +""" + +## Find bright students and weak students + +from dotenv import load_dotenv +import os + +base = os.path.dirname(__file__) +load_dotenv(os.path.join(base, ".env")) +student_record = os.getenv("STUDENTS_RECORD_FILE") + +import pickle +import logging + +# Define logger with info +# import polar + + +## ! Unoptimised rehne de abhi ke liye + + +def remcount(): + with open(student_record, "rb") as F: + val = pickle.load(F) + count = 0 + weak_students = [] + + for student in val: + if student[2] <= 40: + print(f"{student} eligible for remedial") + weak_students.append(student) + count += 1 + print(f"the total number of weak students are {count}") + print(f"The weak students are {weak_students}") + + # ! highest marks is the key here first marks + + +def firstmark(): + with open(student_record, "rb") as F: + val = pickle.load(F) + count = 0 + main = [i[2] for i in val] + + top = max(main) + print(top, "is the first mark") + + for i in val: + if top == i[2]: + print(f"{i}\ncongrats") + count += 1 + print("The total number of students who secured top marks are", count) + + +remcount() +firstmark() diff --git a/1 File handle/File handle binary/read.py b/File_Handling/File handle binary/read.py similarity index 100% rename from 1 File handle/File handle binary/read.py rename to File_Handling/File handle binary/read.py diff --git a/1 File handle/File handle binary/search record in binary file.py b/File_Handling/File handle binary/search record in binary file.py similarity index 95% rename from 1 File handle/File handle binary/search record in binary file.py rename to File_Handling/File handle binary/search record in binary file.py index a6529e15240..0acd90d5138 100644 --- a/1 File handle/File handle binary/search record in binary file.py +++ b/File_Handling/File handle binary/search record in binary file.py @@ -1,22 +1,22 @@ -# binary file to search a given record - -import pickle -from dotenv import load_dotenv - - -def search(): - with open("student_records.pkl", "rb") as F: - # your file path will be different - search = True - rno = int(input("Enter the roll number of the student")) - - for i in pickle.load(F): - if i[0] == rno: - print(f"Record found successfully\n{i}") - search = False - - if search: - print("Sorry! record not found") - - -binary_search() +# binary file to search a given record + +import pickle +from dotenv import load_dotenv + + +def search(): + with open("student_records.pkl", "rb") as F: + # your file path will be different + search = True + rno = int(input("Enter the roll number of the student")) + + for i in pickle.load(F): + if i[0] == rno: + print(f"Record found successfully\n{i}") + search = False + + if search: + print("Sorry! record not found") + + +binary_search() diff --git a/1 File handle/File handle binary/update2.py b/File_Handling/File handle binary/update2.py similarity index 100% rename from 1 File handle/File handle binary/update2.py rename to File_Handling/File handle binary/update2.py diff --git a/1 File handle/File handle text/counter.py b/File_Handling/File handle text/counter.py similarity index 100% rename from 1 File handle/File handle text/counter.py rename to File_Handling/File handle text/counter.py diff --git a/1 File handle/File handle text/file handle 12 length of line in text file.py b/File_Handling/File handle text/file handle 12 length of line in text file.py similarity index 96% rename from 1 File handle/File handle text/file handle 12 length of line in text file.py rename to File_Handling/File handle text/file handle 12 length of line in text file.py index 608f1bf94e3..1280c21b245 100644 --- a/1 File handle/File handle text/file handle 12 length of line in text file.py +++ b/File_Handling/File handle text/file handle 12 length of line in text file.py @@ -1,38 +1,38 @@ -import os -import time - -file_name = input("Enter the file name to create:- ") - -print(file_name) - - -def write_to_file(file_name): - if os.path.exists(file_name): - print(f"Error: {file_name} already exists.") - return - - with open(file_name, "a") as F: - while True: - text = input("enter any text to add in the file:- ") - F.write(f"{text}\n") - choice = input("Do you want to enter more, y/n").lower() - if choice == "n": - break - - -def longlines(): - with open(file_name, encoding="utf-8") as F: - lines = F.readlines() - lines_less_than_50 = list(filter(lambda line: len(line) < 50, lines)) - - if not lines_less_than_50: - print("There is no line which is less than 50") - else: - for i in lines_less_than_50: - print(i, end="\t") - - -if __name__ == "__main__": - write_to_file(file_name) - time.sleep(1) - longlines() +import os +import time + +file_name = input("Enter the file name to create:- ") + +print(file_name) + + +def write_to_file(file_name): + if os.path.exists(file_name): + print(f"Error: {file_name} already exists.") + return + + with open(file_name, "a") as F: + while True: + text = input("enter any text to add in the file:- ") + F.write(f"{text}\n") + choice = input("Do you want to enter more, y/n").lower() + if choice == "n": + break + + +def longlines(): + with open(file_name, encoding="utf-8") as F: + lines = F.readlines() + lines_less_than_50 = list(filter(lambda line: len(line) < 50, lines)) + + if not lines_less_than_50: + print("There is no line which is less than 50") + else: + for i in lines_less_than_50: + print(i, end="\t") + + +if __name__ == "__main__": + write_to_file(file_name) + time.sleep(1) + longlines() diff --git a/1 File handle/File handle text/happy.txt b/File_Handling/File handle text/happy.txt similarity index 96% rename from 1 File handle/File handle text/happy.txt rename to File_Handling/File handle text/happy.txt index c5ca39434bb..ce9edea82d1 100644 --- a/1 File handle/File handle text/happy.txt +++ b/File_Handling/File handle text/happy.txt @@ -1,11 +1,11 @@ -hello how are you -what is your name -do not worry everything is alright -everything will be alright -please don't lose hope -Wonders are on the way -Take a walk in the park -At the end of the day you are more important than anything else. -Many moments of happiness are waiting -You are amazing! +hello how are you +what is your name +do not worry everything is alright +everything will be alright +please don't lose hope +Wonders are on the way +Take a walk in the park +At the end of the day you are more important than anything else. +Many moments of happiness are waiting +You are amazing! If you truly believe. \ No newline at end of file diff --git a/1 File handle/File handle text/input,output and error streams.py b/File_Handling/File handle text/input,output and error streams.py similarity index 96% rename from 1 File handle/File handle text/input,output and error streams.py rename to File_Handling/File handle text/input,output and error streams.py index 65c7b4462bc..a83319f8b5a 100644 --- a/1 File handle/File handle text/input,output and error streams.py +++ b/File_Handling/File handle text/input,output and error streams.py @@ -1,16 +1,16 @@ -# practicing with streams -import sys - -sys.stdout.write("Enter the name of the file") -file = sys.stdin.readline() - -with open( - file.strip(), -) as F: - while True: - ch = F.readlines() - for i in ch: # ch is the whole file,for i in ch gives lines, for j in i gives letters,for j in i.split gives words - print(i, end="") - else: - sys.stderr.write("End of file reached") - break +# practicing with streams +import sys + +sys.stdout.write("Enter the name of the file") +file = sys.stdin.readline() + +with open( + file.strip(), +) as F: + while True: + ch = F.readlines() + for i in ch: # ch is the whole file,for i in ch gives lines, for j in i gives letters,for j in i.split gives words + print(i, end="") + else: + sys.stderr.write("End of file reached") + break diff --git a/1 File handle/File handle text/question 2.py b/File_Handling/File handle text/question 2.py similarity index 96% rename from 1 File handle/File handle text/question 2.py rename to File_Handling/File handle text/question 2.py index b369b564373..58a69f0b27d 100644 --- a/1 File handle/File handle text/question 2.py +++ b/File_Handling/File handle text/question 2.py @@ -1,32 +1,32 @@ -"""Write a method/function DISPLAYWORDS() in python to read lines - from a text file STORY.TXT, - using read function -and display those words, which are less than 4 characters.""" - -print("Hey!! You can print the word which are less then 4 characters") - - -def display_words(file_path): - try: - with open(file_path) as F: - words = F.read().split() - words_less_than_40 = list(filter(lambda word: len(word) < 4, words)) - - for word in words_less_than_40: - print(word) - - return ( - "The total number of the word's count which has less than 4 characters", - (len(words_less_than_40)), - ) - - except FileNotFoundError: - print("File not found") - - -print("Just need to pass the path of your file..") - -file_path = input("Please, Enter file path: ") - -if __name__ == "__main__": - print(display_words(file_path)) +"""Write a method/function DISPLAYWORDS() in python to read lines + from a text file STORY.TXT, + using read function +and display those words, which are less than 4 characters.""" + +print("Hey!! You can print the word which are less then 4 characters") + + +def display_words(file_path): + try: + with open(file_path) as F: + words = F.read().split() + words_less_than_40 = list(filter(lambda word: len(word) < 4, words)) + + for word in words_less_than_40: + print(word) + + return ( + "The total number of the word's count which has less than 4 characters", + (len(words_less_than_40)), + ) + + except FileNotFoundError: + print("File not found") + + +print("Just need to pass the path of your file..") + +file_path = input("Please, Enter file path: ") + +if __name__ == "__main__": + print(display_words(file_path)) diff --git a/1 File handle/File handle text/question 5.py b/File_Handling/File handle text/question 5.py similarity index 96% rename from 1 File handle/File handle text/question 5.py rename to File_Handling/File handle text/question 5.py index de03fbb81fd..1c3ec52935e 100644 --- a/1 File handle/File handle text/question 5.py +++ b/File_Handling/File handle text/question 5.py @@ -1,40 +1,40 @@ -"""Write a function in python to count the number of lowercase -alphabets present in a text file “happy.txt""" - -import time -import os -from counter import Counter - -print( - "You will see the count of lowercase, uppercase and total count of alphabets in provided file.." -) - - -file_path = input("Please, Enter file path: ") - -if os.path.exists(file_path): - print("The file exists and this is the path:\n", file_path) - - -def lowercase(file_path): - try: - with open(file_path) as F: - word_counter = Counter(F.read()) - - print( - f"The total number of lower case letters are {word_counter.get_total_lower()}" - ) - time.sleep(0.5) - print( - f"The total number of upper case letters are {word_counter.get_total_upper()}" - ) - time.sleep(0.5) - print(f"The total number of letters are {word_counter.get_total()}") - time.sleep(0.5) - - except FileNotFoundError: - print("File is not exist.. Please check AGAIN") - - -if __name__ == "__main__": - lowercase(file_path) +"""Write a function in python to count the number of lowercase +alphabets present in a text file “happy.txt""" + +import time +import os +from counter import Counter + +print( + "You will see the count of lowercase, uppercase and total count of alphabets in provided file.." +) + + +file_path = input("Please, Enter file path: ") + +if os.path.exists(file_path): + print("The file exists and this is the path:\n", file_path) + + +def lowercase(file_path): + try: + with open(file_path) as F: + word_counter = Counter(F.read()) + + print( + f"The total number of lower case letters are {word_counter.get_total_lower()}" + ) + time.sleep(0.5) + print( + f"The total number of upper case letters are {word_counter.get_total_upper()}" + ) + time.sleep(0.5) + print(f"The total number of letters are {word_counter.get_total()}") + time.sleep(0.5) + + except FileNotFoundError: + print("File is not exist.. Please check AGAIN") + + +if __name__ == "__main__": + lowercase(file_path) diff --git a/1 File handle/File handle text/question 6.py b/File_Handling/File handle text/question 6.py similarity index 96% rename from 1 File handle/File handle text/question 6.py rename to File_Handling/File handle text/question 6.py index a942d9db5c6..e8fde939b4c 100644 --- a/1 File handle/File handle text/question 6.py +++ b/File_Handling/File handle text/question 6.py @@ -1,21 +1,21 @@ -"""Write a function in python to count the number of lowercase -alphabets present in a text file “happy.txt”""" - -from counter import Counter - - -def lowercase(): - with open("happy.txt") as F: - word_counter = Counter(F.read()) - - print( - f"The total number of lower case letters are {word_counter.get_total_lower()}" - ) - print( - f"The total number of upper case letters are {word_counter.get_total_upper()}" - ) - print(f"The total number of letters are {word_counter.get_total()}") - - -if __name__ == "__main__": - lowercase() +"""Write a function in python to count the number of lowercase +alphabets present in a text file “happy.txt”""" + +from counter import Counter + + +def lowercase(): + with open("happy.txt") as F: + word_counter = Counter(F.read()) + + print( + f"The total number of lower case letters are {word_counter.get_total_lower()}" + ) + print( + f"The total number of upper case letters are {word_counter.get_total_upper()}" + ) + print(f"The total number of letters are {word_counter.get_total()}") + + +if __name__ == "__main__": + lowercase() diff --git a/1 File handle/File handle text/question3.py b/File_Handling/File handle text/question3.py similarity index 96% rename from 1 File handle/File handle text/question3.py rename to File_Handling/File handle text/question3.py index 924a178638b..7a771e8994d 100644 --- a/1 File handle/File handle text/question3.py +++ b/File_Handling/File handle text/question3.py @@ -1,47 +1,47 @@ -"""Write a user-defined function named count() that will read -the contents of text file named “happy.txt” and count -the number of lines which starts with either “I‟ or “M‟.""" - -import os -import time - -file_name = input("Enter the file name to create:- ") - -# step1: -print(file_name) - - -def write_to_file(file_name): - if os.path.exists(file_name): - print(f"Error: {file_name} already exists.") - - else: - with open(file_name, "a") as F: - while True: - text = input("enter any text") - F.write(f"{text}\n") - - if input("do you want to enter more, y/n").lower() == "n": - break - - -# step2: -def check_first_letter(): - with open(file_name) as F: - lines = F.read().split() - - # store all starting letters from each line in one string after converting to lower case - first_letters = "".join([line[0].lower() for line in lines]) - - count_i = first_letters.count("i") - count_m = first_letters.count("m") - - print( - f"The total number of sentences starting with I or M are {count_i + count_m}" - ) - - -if __name__ == "__main__": - write_to_file(file_name) - time.sleep(1) - check_first_letter() +"""Write a user-defined function named count() that will read +the contents of text file named “happy.txt” and count +the number of lines which starts with either “I‟ or “M‟.""" + +import os +import time + +file_name = input("Enter the file name to create:- ") + +# step1: +print(file_name) + + +def write_to_file(file_name): + if os.path.exists(file_name): + print(f"Error: {file_name} already exists.") + + else: + with open(file_name, "a") as F: + while True: + text = input("enter any text") + F.write(f"{text}\n") + + if input("do you want to enter more, y/n").lower() == "n": + break + + +# step2: +def check_first_letter(): + with open(file_name) as F: + lines = F.read().split() + + # store all starting letters from each line in one string after converting to lower case + first_letters = "".join([line[0].lower() for line in lines]) + + count_i = first_letters.count("i") + count_m = first_letters.count("m") + + print( + f"The total number of sentences starting with I or M are {count_i + count_m}" + ) + + +if __name__ == "__main__": + write_to_file(file_name) + time.sleep(1) + check_first_letter() diff --git a/1 File handle/File handle text/special symbol after word.py b/File_Handling/File handle text/special symbol after word.py similarity index 95% rename from 1 File handle/File handle text/special symbol after word.py rename to File_Handling/File handle text/special symbol after word.py index 1e23af6bddb..6e44cc99321 100644 --- a/1 File handle/File handle text/special symbol after word.py +++ b/File_Handling/File handle text/special symbol after word.py @@ -1,11 +1,11 @@ -with open("happy.txt", "r") as F: - # method 1 - for i in F.read().split(): - print(i, "*", end="") - print("\n") - - # method 2 - F.seek(0) - for line in F.readlines(): - for word in line.split(): - print(word, "*", end="") +with open("happy.txt", "r") as F: + # method 1 + for i in F.read().split(): + print(i, "*", end="") + print("\n") + + # method 2 + F.seek(0) + for line in F.readlines(): + for word in line.split(): + print(word, "*", end="") diff --git a/1 File handle/File handle text/story.txt b/File_Handling/File handle text/story.txt similarity index 97% rename from 1 File handle/File handle text/story.txt rename to File_Handling/File handle text/story.txt index eb78dae4be8..c9f59eb01c6 100644 --- a/1 File handle/File handle text/story.txt +++ b/File_Handling/File handle text/story.txt @@ -1,5 +1,5 @@ -once upon a time there was a king. -he was powerful and happy. -he -all the flowers in his garden were beautiful. +once upon a time there was a king. +he was powerful and happy. +he +all the flowers in his garden were beautiful. he lived happily ever after. \ No newline at end of file diff --git a/Koch Curve/README.txt b/Koch_Curve/README.txt similarity index 98% rename from Koch Curve/README.txt rename to Koch_Curve/README.txt index ed93fc72c75..7b5cbac4103 100644 --- a/Koch Curve/README.txt +++ b/Koch_Curve/README.txt @@ -1,38 +1,38 @@ -The Koch snowflake (also known as the Koch curve, Koch star, or Koch island) is a mathematical curve and one of the earliest fractal curves -to have been described. It is based on the Koch curve, which appeared in a 1904 paper titled On a continuous curve without tangents, -constructible from elementary geometry by the Swedish mathematician Helge von Koch. - -How to construct one: - -Step 1: -Draw an equilateral triangle. You can draw it with a compass or protractor, or just eyeball it if you don't want to spend too much time draw -ing the snowflake. It's best if the length of the sides are divisible by 3, because of the nature of this fractal. This will become clear -in the next few steps. - -Step 2: -Divide each side in three equal parts. This is why it is handy to have the sides divisible by three. - -Step 3: -Draw an equilateral triangle on each middle part. Measure the length of the middle third to know the length of the sides of these new -triangles. - -Step 4: -Divide each outer side into thirds. You can see the 2nd generation of triangles covers a bit of the first. These three line segments -shouldn't be parted in three. - -Step 5: -Draw an equilateral triangle on each middle part. Note how you draw each next generation of parts that are one 3rd of the mast one. - -Step 6: -Repeat until you're satisfied with the amount of iterations. It will become harder and harder to accurately draw the new triangles, but -with a fine pencil and lots of patience you can reach the 8th iteration. The one shown in the picture is a Koch snowflake of the 4th -iteration. - -Step 7: -Decorate your snowflake how you like it. You can colour it, cut it out, draw more triangles on the inside, or just leave it the way it is. - - -Reference Links: -http://www.geeksforgeeks.org/koch-curve-koch-snowflake/ -https://www.wikihow.com/Draw-the-Koch-Snowflake +The Koch snowflake (also known as the Koch curve, Koch star, or Koch island) is a mathematical curve and one of the earliest fractal curves +to have been described. It is based on the Koch curve, which appeared in a 1904 paper titled On a continuous curve without tangents, +constructible from elementary geometry by the Swedish mathematician Helge von Koch. + +How to construct one: + +Step 1: +Draw an equilateral triangle. You can draw it with a compass or protractor, or just eyeball it if you don't want to spend too much time draw +ing the snowflake. It's best if the length of the sides are divisible by 3, because of the nature of this fractal. This will become clear +in the next few steps. + +Step 2: +Divide each side in three equal parts. This is why it is handy to have the sides divisible by three. + +Step 3: +Draw an equilateral triangle on each middle part. Measure the length of the middle third to know the length of the sides of these new +triangles. + +Step 4: +Divide each outer side into thirds. You can see the 2nd generation of triangles covers a bit of the first. These three line segments +shouldn't be parted in three. + +Step 5: +Draw an equilateral triangle on each middle part. Note how you draw each next generation of parts that are one 3rd of the mast one. + +Step 6: +Repeat until you're satisfied with the amount of iterations. It will become harder and harder to accurately draw the new triangles, but +with a fine pencil and lots of patience you can reach the 8th iteration. The one shown in the picture is a Koch snowflake of the 4th +iteration. + +Step 7: +Decorate your snowflake how you like it. You can colour it, cut it out, draw more triangles on the inside, or just leave it the way it is. + + +Reference Links: +http://www.geeksforgeeks.org/koch-curve-koch-snowflake/ +https://www.wikihow.com/Draw-the-Koch-Snowflake https://en.wikipedia.org/wiki/Koch_snowflake \ No newline at end of file diff --git a/Koch Curve/koch curve.py b/Koch_Curve/koch curve.py similarity index 96% rename from Koch Curve/koch curve.py rename to Koch_Curve/koch curve.py index 77b31cc22f5..90777073dd8 100644 --- a/Koch Curve/koch curve.py +++ b/Koch_Curve/koch curve.py @@ -1,36 +1,36 @@ -# importing the libraries -# turtle standard graphics library for python -import turtle - - -# function to create koch snowflake or koch curve -def snowflake(lengthSide, levels): - if levels == 0: - t.forward(lengthSide) - return - lengthSide /= 3.0 - snowflake(lengthSide, levels - 1) - t.left(60) - snowflake(lengthSide, levels - 1) - t.right(120) - snowflake(lengthSide, levels - 1) - t.left(60) - snowflake(lengthSide, levels - 1) - - -# main function -if __name__ == "__main__": - t = turtle.Pen() - t.speed(0) # defining the speed of the turtle - length = 300.0 # - t.penup() # Pull the pen up – no drawing when moving. - # Move the turtle backward by distance, opposite to the direction the turtle is headed. - # Do not change the turtle’s heading. - t.backward(length / 2.0) - t.pendown() - for i in range(3): - # Pull the pen down – drawing when moving. - snowflake(length, 4) - t.right(120) - # To control the closing windows of the turtle - # mainloop() +# importing the libraries +# turtle standard graphics library for python +import turtle + + +# function to create koch snowflake or koch curve +def snowflake(lengthSide, levels): + if levels == 0: + t.forward(lengthSide) + return + lengthSide /= 3.0 + snowflake(lengthSide, levels - 1) + t.left(60) + snowflake(lengthSide, levels - 1) + t.right(120) + snowflake(lengthSide, levels - 1) + t.left(60) + snowflake(lengthSide, levels - 1) + + +# main function +if __name__ == "__main__": + t = turtle.Pen() + t.speed(0) # defining the speed of the turtle + length = 300.0 # + t.penup() # Pull the pen up – no drawing when moving. + # Move the turtle backward by distance, opposite to the direction the turtle is headed. + # Do not change the turtle’s heading. + t.backward(length / 2.0) + t.pendown() + for i in range(3): + # Pull the pen down – drawing when moving. + snowflake(length, 4) + t.right(120) + # To control the closing windows of the turtle + # mainloop() diff --git a/Koch Curve/output_2.mp4 b/Koch_Curve/output_2.mp4 similarity index 100% rename from Koch Curve/output_2.mp4 rename to Koch_Curve/output_2.mp4 diff --git a/Laundary System/README.md b/Laundry_System/README.md similarity index 100% rename from Laundary System/README.md rename to Laundry_System/README.md diff --git a/Laundary System/code.py b/Laundry_System/code.py similarity index 100% rename from Laundary System/code.py rename to Laundry_System/code.py diff --git a/Password Generator/requirements_new.txt b/Password Generator/requirements_new.txt deleted file mode 100644 index 8b137891791..00000000000 --- a/Password Generator/requirements_new.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Password Generator/pass_gen.py b/Password_Generator/pass_gen.py similarity index 99% rename from Password Generator/pass_gen.py rename to Password_Generator/pass_gen.py index 82b939cd882..593d99c7f47 100644 --- a/Password Generator/pass_gen.py +++ b/Password_Generator/pass_gen.py @@ -91,4 +91,4 @@ def run(self): self.decide_operation() -Run().run() +Run().run() \ No newline at end of file diff --git a/Password Generator/requirements.txt b/Password_Generator/requirements.txt similarity index 100% rename from Password Generator/requirements.txt rename to Password_Generator/requirements.txt diff --git a/Password Manager Using Tkinter/PGV.py b/Password_Manager_Using_Tkinter/PGV.py similarity index 96% rename from Password Manager Using Tkinter/PGV.py rename to Password_Manager_Using_Tkinter/PGV.py index 045625ea650..3ce183e5984 100644 --- a/Password Manager Using Tkinter/PGV.py +++ b/Password_Manager_Using_Tkinter/PGV.py @@ -1,18 +1,18 @@ -import json - -new_data = { - website_input.get():{ - "email": email_input.get(), - "password": passw_input.get() - } - } - -try: - with open("data.json", "r") as data_file: - data = json.load(data_file) -except FileNotFoundError: - with open("data.json", "w") as data_file: - pass -else: - with open("data.json", "w") as data_file: +import json + +new_data = { + website_input.get():{ + "email": email_input.get(), + "password": passw_input.get() + } + } + +try: + with open("data.json", "r") as data_file: + data = json.load(data_file) +except FileNotFoundError: + with open("data.json", "w") as data_file: + pass +else: + with open("data.json", "w") as data_file: json.dump(new_data, data_file, indent = 4) \ No newline at end of file diff --git a/Password Manager Using Tkinter/README.md b/Password_Manager_Using_Tkinter/README.md similarity index 96% rename from Password Manager Using Tkinter/README.md rename to Password_Manager_Using_Tkinter/README.md index a31bf876550..4352d14390f 100644 --- a/Password Manager Using Tkinter/README.md +++ b/Password_Manager_Using_Tkinter/README.md @@ -1,68 +1,68 @@ -# My Personal Password Manager - -Hello there! Welcome to my Password Manager project. I created this application to provide a simple and secure way **to manage all my website login credentials in one place**. It's a desktop application **built with Python**, and I've focused on making it both functional and easy on the eyes. - ---- - -## What It Can Do - -- **Generate Strong Passwords**: One click = secure, random passwords (auto-copied to clipboard!). - -- **Save Credentials**: Store site name, email/username, and password safely. - -- **Quick Search**: Instantly find saved logins by website name. - -- **View All Passwords**: Unlock all saved entries with your master password — neatly organized in a table. - -- **One-Click Copy**: Copy email or password directly from the list for quick logins. - ---- - -## How I Built It - -- **Python**: Powers the core logic behind the app. - -- **Tkinter**: Handles the clean and simple user interface. - -- **ttkbootstrap**: Adds a modern, professional theme to the UI. - -- **JSON**: Stores all password data securely in a local data.json file. - ---- - -## How to Get Started - -1. Install Python 3 on your system. - -2. Download all project files (main.py, logo.png, requirements.txt). - -3. Open Terminal/CMD, navigate to the project folder, and run: -```python -pip install -r requirements.txt -``` - -4. Start the app with: -```python -python main.py -``` - -5. Enjoy! - ---- - -## Screenshots - - - - - - - - - - -
Main Window where from where you can add credentialsMain Window
Second window — where you can see all your saved passwords (but hey, you’ll need a password to see your passwords 😏). -Main Window
- - - +# My Personal Password Manager + +Hello there! Welcome to my Password Manager project. I created this application to provide a simple and secure way **to manage all my website login credentials in one place**. It's a desktop application **built with Python**, and I've focused on making it both functional and easy on the eyes. + +--- + +## What It Can Do + +- **Generate Strong Passwords**: One click = secure, random passwords (auto-copied to clipboard!). + +- **Save Credentials**: Store site name, email/username, and password safely. + +- **Quick Search**: Instantly find saved logins by website name. + +- **View All Passwords**: Unlock all saved entries with your master password — neatly organized in a table. + +- **One-Click Copy**: Copy email or password directly from the list for quick logins. + +--- + +## How I Built It + +- **Python**: Powers the core logic behind the app. + +- **Tkinter**: Handles the clean and simple user interface. + +- **ttkbootstrap**: Adds a modern, professional theme to the UI. + +- **JSON**: Stores all password data securely in a local data.json file. + +--- + +## How to Get Started + +1. Install Python 3 on your system. + +2. Download all project files (main.py, logo.png, requirements.txt). + +3. Open Terminal/CMD, navigate to the project folder, and run: +```python +pip install -r requirements.txt +``` + +4. Start the app with: +```python +python main.py +``` + +5. Enjoy! + +--- + +## Screenshots + + + + + + + + + + +
Main Window where from where you can add credentialsMain Window
Second window — where you can see all your saved passwords (but hey, you’ll need a password to see your passwords 😏). +Main Window
+ + + diff --git a/Password Manager Using Tkinter/data.json b/Password_Manager_Using_Tkinter/data.json similarity index 96% rename from Password Manager Using Tkinter/data.json rename to Password_Manager_Using_Tkinter/data.json index 399ea997575..1c6a8957608 100644 --- a/Password Manager Using Tkinter/data.json +++ b/Password_Manager_Using_Tkinter/data.json @@ -1,14 +1,14 @@ -{ - "Amazon": { - "email": "prashant123Amazon@gmail.com", - "password": "1mD%#Z555rF$&2aRpI" - }, - "Facebook": { - "email": "prashant123Facebook@gmail.com", - "password": "qQ6#H7o&)i8S!3sO)c4" - }, - "Flipkart": { - "email": "prashant123Flipkart@gmail.com", - "password": "1!+7NqmUZbN18K(3A+" - } +{ + "Amazon": { + "email": "prashant123Amazon@gmail.com", + "password": "1mD%#Z555rF$&2aRpI" + }, + "Facebook": { + "email": "prashant123Facebook@gmail.com", + "password": "qQ6#H7o&)i8S!3sO)c4" + }, + "Flipkart": { + "email": "prashant123Flipkart@gmail.com", + "password": "1!+7NqmUZbN18K(3A+" + } } \ No newline at end of file diff --git a/Password Manager Using Tkinter/data.txt b/Password_Manager_Using_Tkinter/data.txt similarity index 100% rename from Password Manager Using Tkinter/data.txt rename to Password_Manager_Using_Tkinter/data.txt diff --git a/Password Manager Using Tkinter/logo.png b/Password_Manager_Using_Tkinter/logo.png similarity index 100% rename from Password Manager Using Tkinter/logo.png rename to Password_Manager_Using_Tkinter/logo.png diff --git a/Password Manager Using Tkinter/main.py b/Password_Manager_Using_Tkinter/main.py similarity index 100% rename from Password Manager Using Tkinter/main.py rename to Password_Manager_Using_Tkinter/main.py diff --git a/Password Manager Using Tkinter/requirements.txt b/Password_Manager_Using_Tkinter/requirements.txt similarity index 100% rename from Password Manager Using Tkinter/requirements.txt rename to Password_Manager_Using_Tkinter/requirements.txt diff --git a/Python Programs/Program of Reverse of any number.py b/Python_Programs/Program of Reverse of any number.py similarity index 100% rename from Python Programs/Program of Reverse of any number.py rename to Python_Programs/Program of Reverse of any number.py diff --git a/Python Programs/Program to print table of given number.py b/Python_Programs/Program to print table of given number.py similarity index 100% rename from Python Programs/Program to print table of given number.py rename to Python_Programs/Program to print table of given number.py diff --git a/Python Programs/Program to reverse Linked List( Recursive solution).py b/Python_Programs/Program to reverse Linked List( Recursive solution).py similarity index 100% rename from Python Programs/Program to reverse Linked List( Recursive solution).py rename to Python_Programs/Program to reverse Linked List( Recursive solution).py diff --git a/Python Programs/Python Program for Product of unique prime factors of a number.py b/Python_Programs/Python Program for Product of unique prime factors of a number.py similarity index 100% rename from Python Programs/Python Program for Product of unique prime factors of a number.py rename to Python_Programs/Python Program for Product of unique prime factors of a number.py diff --git a/Python Programs/Python Program for Tower of Hanoi.py b/Python_Programs/Python Program for Tower of Hanoi.py similarity index 100% rename from Python Programs/Python Program for Tower of Hanoi.py rename to Python_Programs/Python Program for Tower of Hanoi.py diff --git a/Python Programs/Python Program for factorial of a number.py b/Python_Programs/Python Program for factorial of a number.py similarity index 100% rename from Python Programs/Python Program for factorial of a number.py rename to Python_Programs/Python Program for factorial of a number.py diff --git a/Python Programs/Python Program to Count the Number of Each Vowel.py b/Python_Programs/Python Program to Count the Number of Each Vowel.py similarity index 100% rename from Python Programs/Python Program to Count the Number of Each Vowel.py rename to Python_Programs/Python Program to Count the Number of Each Vowel.py diff --git a/Python Programs/Python Program to Display Fibonacci Sequence Using Recursion.py b/Python_Programs/Python Program to Display Fibonacci Sequence Using Recursion.py similarity index 100% rename from Python Programs/Python Program to Display Fibonacci Sequence Using Recursion.py rename to Python_Programs/Python Program to Display Fibonacci Sequence Using Recursion.py diff --git a/Python Programs/Python Program to Find LCM.py b/Python_Programs/Python Program to Find LCM.py similarity index 100% rename from Python Programs/Python Program to Find LCM.py rename to Python_Programs/Python Program to Find LCM.py diff --git a/Python Programs/Python Program to Merge Mails.py b/Python_Programs/Python Program to Merge Mails.py similarity index 100% rename from Python Programs/Python Program to Merge Mails.py rename to Python_Programs/Python Program to Merge Mails.py diff --git a/Python Programs/Python Program to Print the Fibonacci sequence.py b/Python_Programs/Python Program to Print the Fibonacci sequence.py similarity index 100% rename from Python Programs/Python Program to Print the Fibonacci sequence.py rename to Python_Programs/Python Program to Print the Fibonacci sequence.py diff --git a/Python Programs/Python Program to Remove Punctuations from a String.py b/Python_Programs/Python Program to Remove Punctuations from a String.py similarity index 100% rename from Python Programs/Python Program to Remove Punctuations from a String.py rename to Python_Programs/Python Program to Remove Punctuations from a String.py diff --git a/Python Programs/Python Program to Reverse a linked list.py b/Python_Programs/Python Program to Reverse a linked list.py similarity index 100% rename from Python Programs/Python Program to Reverse a linked list.py rename to Python_Programs/Python Program to Reverse a linked list.py diff --git a/Python Programs/Python Program to Sort Words in Alphabetic Order.py b/Python_Programs/Python Program to Sort Words in Alphabetic Order.py similarity index 100% rename from Python Programs/Python Program to Sort Words in Alphabetic Order.py rename to Python_Programs/Python Program to Sort Words in Alphabetic Order.py diff --git a/Python Programs/Python Program to Transpose a Matrix.py b/Python_Programs/Python Program to Transpose a Matrix.py similarity index 100% rename from Python Programs/Python Program to Transpose a Matrix.py rename to Python_Programs/Python Program to Transpose a Matrix.py diff --git a/Python Programs/python program for finding square root for positive number.py b/Python_Programs/python program for finding square root for positive number.py similarity index 100% rename from Python Programs/python program for finding square root for positive number.py rename to Python_Programs/python program for finding square root for positive number.py diff --git a/README.md b/README.md index a1521508a59..04c3024d2d2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ -#This is a new repo # My Python Eggs 🐍 😄
@@ -58,4 +57,4 @@ Feel free to explore the scripts and use them for your learning and automation n 43. [smart_file_organizer.py](https://github.com/sangampaudel530/Python2.0/blob/main/smart_file_organizer.py) - Organizes files in a directory into categorized subfolders based on file type (Images, Documents, Videos, Audios, Archives, Scripts, Others). You can run it once or automatically at set intervals using the `--path` and `--interval` options.
-_**Note**: The content in this repository belongs to the respective authors and creators. I'm just providing a formatted README.md for better presentation._ +_**Note**: The content in this repository belongs to the respective authors and creators. I'm just providing a formatted README.md for better presentation. Please do not contribute slop._ diff --git a/Recursion Visulaizer/.recursionVisualizer.py.swp b/Recursion_Visulaizer/.recursionVisualizer.py.swp similarity index 100% rename from Recursion Visulaizer/.recursionVisualizer.py.swp rename to Recursion_Visulaizer/.recursionVisualizer.py.swp diff --git a/Recursion Visulaizer/Meshimproved.PNG b/Recursion_Visulaizer/Meshimproved.PNG similarity index 100% rename from Recursion Visulaizer/Meshimproved.PNG rename to Recursion_Visulaizer/Meshimproved.PNG diff --git a/Recursion Visulaizer/fencedmesh.PNG b/Recursion_Visulaizer/fencedmesh.PNG similarity index 100% rename from Recursion Visulaizer/fencedmesh.PNG rename to Recursion_Visulaizer/fencedmesh.PNG diff --git a/Recursion Visulaizer/git b/Recursion_Visulaizer/git similarity index 100% rename from Recursion Visulaizer/git rename to Recursion_Visulaizer/git diff --git a/Recursion Visulaizer/recursionVisualizer.py b/Recursion_Visulaizer/recursionVisualizer.py similarity index 100% rename from Recursion Visulaizer/recursionVisualizer.py rename to Recursion_Visulaizer/recursionVisualizer.py diff --git a/Youtube Downloader With GUI/Screenshot (138).png b/Youtube_Downloader_With_GUI/Screenshot (138).png similarity index 100% rename from Youtube Downloader With GUI/Screenshot (138).png rename to Youtube_Downloader_With_GUI/Screenshot (138).png diff --git a/Youtube Downloader With GUI/main.py b/Youtube_Downloader_With_GUI/main.py similarity index 100% rename from Youtube Downloader With GUI/main.py rename to Youtube_Downloader_With_GUI/main.py diff --git a/Youtube Downloader With GUI/photo.jpg b/Youtube_Downloader_With_GUI/photo.jpg similarity index 100% rename from Youtube Downloader With GUI/photo.jpg rename to Youtube_Downloader_With_GUI/photo.jpg diff --git a/Youtube Downloader With GUI/photo.png b/Youtube_Downloader_With_GUI/photo.png similarity index 100% rename from Youtube Downloader With GUI/photo.png rename to Youtube_Downloader_With_GUI/photo.png diff --git a/Youtube Downloader With GUI/youtube-ios-app.ico b/Youtube_Downloader_With_GUI/youtube-ios-app.ico similarity index 100% rename from Youtube Downloader With GUI/youtube-ios-app.ico rename to Youtube_Downloader_With_GUI/youtube-ios-app.ico diff --git a/img/hand1.jpg b/img/hand1.jpg deleted file mode 100644 index bdca9932295..00000000000 Binary files a/img/hand1.jpg and /dev/null differ diff --git a/index.html b/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/index.html +++ /dev/null @@ -1 +0,0 @@ -