Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d8985b5
changed the logical error
Anushriuser Dec 6, 2024
1ac33ef
find the largest number
Kanishkaneya1929 Dec 6, 2024
feb1d05
changed syntax which is an error before in palindrome
Anushriuser Dec 6, 2024
4471435
odd or even
Kanishkaneya1929 Dec 6, 2024
084dba4
changed operation and print statement in easy_q1.py
Srihari-tech2dive Dec 6, 2024
81b5759
Merge branch 'main' into main
Srihari-tech2dive Dec 6, 2024
4d2b71c
The number is positive ,Negative, or Zero
Dec 6, 2024
5f31b7b
I have fixed the error
Srihari-tech2dive Dec 6, 2024
8dfbcc3
Merge branch 'main' of https://github.com/Srihari-tech2dive/ErrorHunter
Srihari-tech2dive Dec 6, 2024
2ef1869
initial commit
Dec 6, 2024
54ce642
The number N using a While loop
Dec 6, 2024
daa1c0b
Merge pull request #81 from Mathi27/staging-1
Mathi27 Dec 6, 2024
437cb39
Merge branch 'main' into main
Mathi27 Dec 6, 2024
64d075d
Merge pull request #48 from Anushriuser/main
Mathi27 Dec 6, 2024
f1e6841
Merge branch 'main' into problem
Mathi27 Dec 6, 2024
a200fdd
Merge pull request #53 from Kishore29012007/problem
Mathi27 Dec 6, 2024
82528bb
Merge branch 'main' into main
Mathi27 Dec 6, 2024
62ce77d
I have fixed thr error in easy q2
Srihari-tech2dive Dec 6, 2024
2403d61
Merge branch 'main' of https://github.com/Srihari-tech2dive/ErrorHunter
Srihari-tech2dive Dec 6, 2024
c307bc9
I have changed code in m1
Srihari-tech2dive Dec 6, 2024
b8cd846
I have changed the code in m1
Srihari-tech2dive Dec 8, 2024
0f17197
Update m1.py
Srihari-tech2dive Dec 8, 2024
8f023f6
I have fixed the error in rock_paper_scissor
Srihari-tech2dive Dec 8, 2024
d919c52
Merge branch 'main' of https://github.com/Srihari-tech2dive/ErrorHunter
Srihari-tech2dive Dec 8, 2024
eaa5b40
Update rockPaperSiss.py
Srihari-tech2dive Dec 8, 2024
a10bd7b
I have fixed the error and changed the print statement.
Srihari-tech2dive Dec 8, 2024
ed2325c
I have changed the code
Srihari-tech2dive Dec 8, 2024
133111a
I have changed print statement and fixed errors
Srihari-tech2dive Dec 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ErrorHunter
Submodule ErrorHunter added at 956b48
17 changes: 8 additions & 9 deletions FunProjects/directions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,18 @@ def reduce_dir(directions):
stack = []

for d in directions:
if stack and opposite[d] == stack[-1]:
if stack and opposite[d] == stack[0]:




stack.pop()
stack.pop()
stack.pop()
print(stack.pop())


else:


stack.append(d)

return stack

directions = ["NORTH", "SOUTH", "SOUTH", "EAST", "WEST", "NORTH", "WEST"]


reduce_dir(directions)

70 changes: 35 additions & 35 deletions FunProjects/quiz_main.py
Original file line number Diff line number Diff line change
@@ -1,37 +1,33 @@
# Technology Quiz in Python

import time

def pause(seconds):

time.sleep(seconds)

def ask_question(question):

answer = input(question + "\nAnswer = ")
answer = input(question + "\nAnswer = ").strip().upper()
return answer

def evaluate_question(user_answer, correct_answer, alt_answer, close_answer):
if user_answer == alt_answer:
return True
elif user_answer == correct_answer:
return True
elif user_answer == close_answer:
return "Close"

if user_answer == correct_answer:
return False
elif user_answer in alt_answer:
return False
elif user_answer in close_answer and close_answer:
return "Close"
else:
return True

def answer_response(evaluated):

if evaluated == True:
return "That's not the correct answer!"
return "Oops! That's not the correct answer!"
elif evaluated == "Close":
return "Close! But not quite right. Try again!"
else:
return "Correct! Well done."
return "Correct! Well done."

correct_answers = 0

answer_index = 1
answer_index = 0

questions = [
"Solar power generates electricity from what source?",
Expand Down Expand Up @@ -107,37 +103,41 @@ def answer_response(evaluated):
print("Let's begin the quiz.")
pause(2)


for question in questions:
answer = ask_question(question)
evaluated = evaluate_question(answer, answers[answer_index], alt_answers[answer_index], close_answers[answer_index])


while evaluated == "Close":
pause(1)

answer = ask_question(questions[answer_index])
print(close_responses[answer_index])
answer = ask_question(question)
evaluated = evaluate_question(answer, answers[answer_index], alt_answers[answer_index], close_answers[answer_index])
if evaluated:



if evaluated == False:
correct_answers += 1
pause(1)


print(answer_response(evaluated))
answer_index += 2

answer_index += 1
pause(2)

if correct_answers == 1:
question_amount = "question"
else:
question_amount = "questions"

print("Thanks for taking this quiz, {}.".format(user_name))
print(f"Thanks for taking this quiz, {user_name}.")
pause(2)


if correct_answers == 10:
print("Congratulations, you got all 10 questions correct and have been awarded the gold medal!")
elif correct_answers > 6 and correct_answers < 10:

print("Congratulations, you got {} questions correct and have been awarded the bronze medal!".format(correct_answers))
elif correct_answers > 0 and correct_answers < 6:
print("Congratulations, you got {} {} correct and have been awarded the silver medal!".format(correct_answers, question_amount))
elif 10>correct_answers >=6:
print(f"Congratulations, you got {correct_answers} questions correct and have been awarded the silver medal!")
elif 5>=correct_answers > 0:
print(f"Congratulations, you got {correct_answers} questions correct and have been awarded the bronze medal!")
else:

print("Take the quiz again to try to earn a medal!")
print("Take the quiz again to try and earn a gold medal!")



14 changes: 9 additions & 5 deletions FunProjects/rockPaperSiss.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ def rock_paper_scissors():
if user_choice not in choices:
print("Invalid choice! Try again.")
continue

import random
computer_choice = random.choice(choices)
print(f"Computer chose: {computer_choice}")

if user_choice == computer_choice:
print("It's a tie!")
print("AHAHAH It's a tie! I challenge you for next round human !" )
print("Accept or Afraid")
elif (user_choice == "rock" and computer_choice == "scissors") or \
(user_choice == "scissors" and computer_choice == "paper") or \
(user_choice == "paper" and computer_choice == "rock"):
Expand All @@ -25,15 +26,18 @@ def rock_paper_scissors():
def main():
while True:
print("\nMenu:")
print("1. Play Rock, Paper, Scissors")
print("2. Exit")
print("1. I Changelle you to play Rock, Paper, Scissors")
print ("2. Accept")
print("3. Reject")

choice = input("Enter your choice: ")

if choice == "1":
rock_paper_scissors()
elif choice == "2":
print("Thanks for playing!")
rock_paper_scissors()
elif choice == "3":
print("Are you afraid of me ?")
break
else:
print("Invalid choice! Please try again.")
Expand Down
6 changes: 2 additions & 4 deletions problems/easy/easy_q1.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
else:
print("{0} is Odd".format(num))

if (num % 2) != 0:
print("{0} is Odd".format(num))
else:
print("{0} is Even".format(num))





3 changes: 3 additions & 0 deletions problems/easy/easy_q10.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ def is_palindrome(num):
while num != 0:
reverse = reverse * 10 + num % 10
num //= 10




return reverse == original

reverse = ''
Expand Down
33 changes: 7 additions & 26 deletions problems/easy/easy_q2.py
Original file line number Diff line number Diff line change
@@ -1,43 +1,24 @@
# Find the Largest Number: Accept two numbers and print the larger one.
def largest_of_two(a, b):
if a > b:

return a
return a

else:
return b

if __name__ == "__main__":
num1 = int(input("Enter the First Number :"))
num2 = int(input("Enter the Second Number :"))
res = largest_of_two(num1,num2)
print(res)

print(num1,"larger")
else:
print(num2,"larger")

if __name__ == "__main__":
num1 = int(input("Enter the First Number :"))
num2 = int(input("Enter the Second :"))
res = largest_of_two(num1,num1)
print(res)


return a
res = largest_of_two(num1,num2)

return a

else:
return b
if __name__ == "__main__":
num1 = int(input("Enter the First Number :"))
num2 = int(input("Enter the Second Number :"))
res = largest_of_two(num1,num2)
keerthi
print("The Largest Number is",res)


print(res)


main




8 changes: 8 additions & 0 deletions problems/easy/easy_q6.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ def print_numbers(n):
i = 1
while i <= n:
print(i)

i+= 1
if __name__ == "__main__":
num = int(input("Enter the Number: "))
res = print_numbers(num)
print(res)

i += 1

if __name__ == "__main__":
Expand All @@ -13,3 +20,4 @@ def print_numbers(n):
num = int(input("Enter the Number :"))
print_numbers(num)


50 changes: 25 additions & 25 deletions problems/medium/m1.py
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
'''
Create a menu to perform basic mathematical operations (addition, subtraction, multiplication, division, modulo) on two numbers.

'''
choice=int(input("Enter no. of choice:"))
def math_operations_menu(choice):
a, b = map(int, input("Enter two numbers(separated by commas): ").split(sep=","))


if choice == 2:
print("Subtraction:", a - b)
elif choice == 1:
print("Addition:", a + b)
elif choice == 4:
print("Division:", a / b)
a, b = map(int,input("Enter two numbers(separated by commas): ").split(sep=","))
if choice == 1:
print(a + b)
elif choice == 2:
print(a - b)
elif choice == 3:
print("Multiplication:", a * b)

print(a * b)
elif choice == 4:
print(a / b)
elif choice == 5:
print(a % b)
elif choice == 6:
print(a ** b)

if choice == 1:
print(f"Subtraction of {a} and {b}:{a - b}")
print(f"Addition of {a} and {b}:{a + b}")
elif choice == 2:
print(f"Addition of {a} and {b}:{a + b}")
print(f"Subtraction of {a} and {b}:{a - b}")
elif choice == 3:
print(f"Division of {a} and {b}:{a / b}")
elif choice == 4:
print(f"Multiplication of {a} and {b}:{a * b}")
elif choice == 5:
print(f"Modulus of {a} and {b}:{a // b}")
elif choice == 4:
print(f"Division of {a} and {b}:{a / b}")
elif choice == 5:
print(f"Modulus of {a} and {b}:{a % b}")
elif choice == 6:
print(f"{a} to the power of {b}:{a**b}")
else:
print("Invalid option")
math_operations_menu()

print("Invalid option!!!")
math_operations_menu(choice)

print("-------------Mathematical operation menu---------------")
print("1. Add")
print("2. Subtract")
print("3. Multiply")
print("4. Divide")
print("5. Modulus")
print("6. Expontential")
choice = int(input("Enter your choice: "))
math_operations_menu(choice)


print("-------------------------------------------------------")