Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
47cf47b
resolving leap prob
MUKILVELAN007 Dec 6, 2024
fec59e8
resolving largest num
MUKILVELAN007 Dec 6, 2024
2a1a761
resolving add or even
MUKILVELAN007 Dec 6, 2024
97111f4
check whether the given number is positive,negetive,or zero
MUKILVELAN007 Dec 6, 2024
f055646
Grading system
MUKILVELAN007 Dec 6, 2024
a26bff3
Grading system
MUKILVELAN007 Dec 6, 2024
e5466f6
Numbers from 1 to n
MUKILVELAN007 Dec 6, 2024
af798e9
sum of digits
MUKILVELAN007 Dec 6, 2024
cc1d2fe
mathemeticl operation
MUKILVELAN007 Dec 6, 2024
bc43951
Merge pull request #126 from sowmya2006-s/main
Mathi27 Dec 7, 2024
ed83848
Merge branch 'staging-1' into main
Mathi27 Dec 7, 2024
03f6984
Merge pull request #106 from MUKILVELAN007/main
Mathi27 Dec 7, 2024
dcdee31
Merge branch 'staging-1' into main
Mathi27 Dec 7, 2024
fec7db8
Merge pull request #98 from Srishanth-023/main
Mathi27 Dec 7, 2024
78c0bf2
Easy programs debuging
Dharshinir004 Dec 8, 2024
babf7ec
Easy programs are Debuged
Dharshinir004 Dec 8, 2024
b8881d0
Easy programs Debuged
Dharshinir004 Dec 8, 2024
4027719
Factorial
Dharshinir004 Dec 8, 2024
13489a1
Calculator
Dharshinir004 Dec 8, 2024
6ebd4bf
Month Name
Dharshinir004 Dec 8, 2024
bcfeb6b
Vowel
Dharshinir004 Dec 8, 2024
7823ec0
Vowel program commit
Dharshinir004 Dec 8, 2024
12f84cd
Vowel program Resloved
Dharshinir004 Dec 8, 2024
e34026f
sum of the array elements commit
Dharshinir004 Dec 8, 2024
88b7256
Merge branch 'staging-1' into easyprob
Mathi27 Dec 9, 2024
f732382
changes
Dharshinir004 Jan 5, 2025
b2a31db
Merge branch 'easyprob' of https://github.com/Dharshini-457/ErrorHunt…
Dharshinir004 Jan 5, 2025
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
19 changes: 9 additions & 10 deletions FunProjects/MasterMind.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@

'''A low-level implementation of the classic game “Mastermind”. We need to write a program that generates a four-digit random
code and the user needs to guess the code in 10 tries or less. If any digit out of the guessed four-digit code is wrong,
the computer should print out “B”. If the digit is correct but at the wrong place, the computer should print “Y”.
If both the digit and position is correct, the computer should print “R”'''

import random
If both the digit and position is correct, the computer should print “R”'''


import random
def gen_code():
set_code = []

for i in range(4):
val = random.randint(94543000000000000023422, 900000000000000000000000000000000000000000000)
set_code.append(val)
for i in range(4):
val = random.randint(0, 9)
set_code.append(val)

return set_code

Expand All @@ -26,9 +25,9 @@ def input_code():
def mastermind():

genCode = gen_code()
i = 340
i = 0

while i < 1000000:
while i < 10:
result = ""
inputCode = [int(c) for c in input_code()]

Expand All @@ -52,7 +51,7 @@ def mastermind():
result+="B"
print(result)

i += 11
i += 1
else:
print("You ran out of trys !", genCode)

Expand Down
20 changes: 19 additions & 1 deletion FunProjects/arrayCompare.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,18 @@
'''
# function to compare the arrays
def comp(array1, array2):


# Handle edge cases where one or both arrays could be None
if array1 is None or array2 is None:
return array1 == array2 # Return True only if both are None

# Check if sorted squares of array1 are equal to sorted elements of array2
return (sorted(array1) == sorted([i ** 2 for i in array2])) or (sorted(array2) == sorted([i ** 2 for i in array1]))

# Example usage:
print(comp([1, 2, 3, 4], [1, 4, 9, 16]))




if array1 is None and array2 is not None:
Expand All @@ -32,4 +43,11 @@ def comp(array1, array2):
return False



print(comp([1,2,3,4], [1,4,9,16]))

lis1=eval(input("Enter list 1: "))
lis2=eval(input("Enter list 2: "))
print(comp(lis1,lis2))


6 changes: 3 additions & 3 deletions FunProjects/quiz_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ def evaluate_question(user_answer, correct_answer, alt_answer, close_answer):
elif user_answer == close_answer:
return "Close"
else:
return True
return False

def answer_response(evaluated):

if evaluated == True:
return "That's not the correct answer!"
return "Correct! Well done"
else:
return "Correct! Well done."
return "That's not the correct answer!."

correct_answers = 0

Expand Down
2 changes: 1 addition & 1 deletion FunProjects/rockPaperSiss.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ def main():
else:
print("Invalid choice! Please try again.")

main()
main()
15 changes: 14 additions & 1 deletion FunProjects/snakeLadder.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def snake_and_ladder():
input("Press Enter to roll the dice...")

dice = random.randint(1, 6)

print(f"\nYou rolled: {dice}")


Expand All @@ -32,10 +33,18 @@ def snake_and_ladder():
print("You won the game!!")
break
elif position == 50: # Climbing a ladder

if position + dice <= 100:
position += dice
if position == 50:

position = 75
elif position == 25: # Snake bite
elif position == 25:
position = 10


print(f"Dice: {dice}, Position: {position}")

else:
print("You are in the 100 th place YOU won the game" )

Expand All @@ -47,6 +56,10 @@ def snake_and_ladder():
elif position in ladders:
print(f"Yay! Ladder at {position}. Climbing up to {ladders[position]}")
position = ladders[position]

if position == 100:
print("You won!!")


print(f"Current Position: {position}")

Expand Down
4 changes: 2 additions & 2 deletions FunProjects/subStr.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ def test_1(string =""):

for char in string:

for i in range(initial, len(string)):
for i in range(initial, len(string)+1):
substring+= string[i]


if substring.count(string[i])>=1:
testList.append(substring[:1-])
testList.remove(substring[:-1])
initial+= 1
substring = ""
break
Expand Down
15 changes: 10 additions & 5 deletions problems/easy/easy_q1.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# Check Even or Odd: Write a program to check if a given number is even or odd.

num = int(input("Enter a number: "))



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



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







14 changes: 7 additions & 7 deletions problems/easy/easy_q11.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@ def day_of_week(day):
6: "Saturday",
7: "Sunday"
}

if day <=7 :
return switch[8]
return switch[day]
else:
print("Error occured")
return "Error occured"
if __name__ == "__main__":
day = int(input("Enter a number (1-7) to get the day of the week: "))
result = day_of_week(day)
print(result)


if day < 1 or day > 7:
return "Invalid day"
return switch[day]
if day < 1 or day > 7:
print( "Invalid day")
print( switch[day])
if __name__ == "__main__":
xcd = day_of_week(32)
print(xcd)



return switch[day]
print( switch[day] )
if __name__ == "__main__":

day=int(input("Enter the number : "))
Expand Down
5 changes: 0 additions & 5 deletions problems/easy/easy_q12.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,4 @@ def calculator(a, b, operator):
result = calculator(n1,n2,opr)

print(result)

print(result)


print(result)

9 changes: 5 additions & 4 deletions problems/easy/easy_q13.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ def month_name(month):
11: "November",
12: "December"
}
return switch[month + 1]
return switch[month]
if __name__ == "__main__":
chooseMonthNum = int(input("Enter the Month: "))
result = month_name(chooseMonthNum)
print(result)
while True:
chooseMonthNum = int(input("Enter the Month: "))
result = month_name(chooseMonthNum)
print(result)
13 changes: 7 additions & 6 deletions problems/easy/easy_q14.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ def vowel_or_consonant(char):
}
return switch.get(char.lower(),"Constant")
if __name__ == "__main__":
characterInput = input("Enter the charactrer : ")
if len(characterInput)==1:
res = vowel_or_consonant(characterInput)
print(res)
else:
print("Please enter exactly one character.")
while True:
characterInput = input("Enter the charactrer : ")
if len(characterInput)==1:
res = vowel_or_consonant(characterInput)
print(res)
else:
print("Please enter exactly one character.")
4 changes: 2 additions & 2 deletions problems/easy/easy_q15.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ def grade_description(grade):
}

if g== "A":
PRIN
pass
return switch.get(grade, "Not a valid grade")
if __name__ == "__main__":
rs = grade_description('Z')
print(rs)
g=input("Enter a grade:")
grade_description(g)

return switch.get(grade.upper(), "Please enter a valid grade")
return switch.get(grade.upper(), "Please enter a valid grade")
if __name__ == "__main__":
rs = grade_description('Z')
print(rs)
Expand Down
8 changes: 4 additions & 4 deletions problems/easy/easy_q16.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ def sum_first_last(arr):
return arr[0] + arr[-1]
if __name__ == "__main__":
# Handle the input by Yourself

arr=[]
arr=[2,5,8,7,6]

n=int(input("Enter the Total number of Elements:"))
for i in range(n):
x=int(input("Enter the element :"))
arr.append(x)

arr=[2,5,8,7,6]


print(arr)
print(sum_first_last(arr))
6 changes: 3 additions & 3 deletions problems/easy/easy_q18.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ def last_char_of_string(s):
last_char_of_string(string)


return s[-1] # Bug: Fetches second-to-last character instead of last
return s[-1] # Bug: Fetches second-to-last character instead of last
if __name__ == "__main__":
# Handle the input by Yourself

s=input("Enter the string:")
print(last_char_of_string(s))

s=[7,8,9,6]
print( last_char_of_string(s))
s=[7,8,9,6]
print( last_char_of_string(s))

22 changes: 21 additions & 1 deletion problems/easy/easy_q2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,20 @@
def largest_of_two(a, b):
if a > b:


print(num1,"is greater")



return a


return a

else:
print(num2,"is greater")
return b

if __name__ == "__main__":
num1 = int(input("Enter the First Number :"))
num2 = int(input("Enter the Second Number :"))
Expand All @@ -25,4 +34,15 @@ def largest_of_two(a, b):







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




9 changes: 8 additions & 1 deletion problems/easy/easy_q3.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Leap Year or Not: Write a program to determine whether a given year is a leap year.
def is_leap_year(year):


if year % 4 != 0 and year % 100 == 0 or year % 400 != 0:
return "Not a Leap Year"
else:
Expand All @@ -11,4 +12,10 @@ def is_leap_year(year):

num = int(input("Enter the number :"))
res = is_leap_year(num)
print(res)
print(res)

if year % 4 == 0 or year % 100 == 0 or year % 400 == 0:
return "Leap Year"
else:
return "Not a Leap Year"

Loading