From 0ffcc7b5e6dba742b4285fd72b1e7be5c8a68472 Mon Sep 17 00:00:00 2001 From: Mehmet Ozturk Date: Thu, 26 Dec 2024 20:33:21 +0100 Subject: [PATCH 01/14] New folder structure --- team_1/haluk/.empty | 0 team_1/islam/.empty | 0 team_1/yasin/.empty | 0 team_1/zehra/.empty | 0 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 team_1/haluk/.empty create mode 100644 team_1/islam/.empty create mode 100644 team_1/yasin/.empty create mode 100644 team_1/zehra/.empty diff --git a/team_1/haluk/.empty b/team_1/haluk/.empty new file mode 100644 index 0000000..e69de29 diff --git a/team_1/islam/.empty b/team_1/islam/.empty new file mode 100644 index 0000000..e69de29 diff --git a/team_1/yasin/.empty b/team_1/yasin/.empty new file mode 100644 index 0000000..e69de29 diff --git a/team_1/zehra/.empty b/team_1/zehra/.empty new file mode 100644 index 0000000..e69de29 From 77eb8837cbbb3875463627082b0ab465c9be2cc3 Mon Sep 17 00:00:00 2001 From: Harriery <98697353+Harriery@users.noreply.github.com> Date: Thu, 26 Dec 2024 23:24:55 +0100 Subject: [PATCH 02/14] The homework is ready. --- team_1/yasin/.empty | 0 team_1/yasin/hackerrank.py | 102 +++++++++++++++++++++++++++++++++++++ team_1/yasin/homework.py | 95 ++++++++++++++++++++++++++++++++++ 3 files changed, 197 insertions(+) delete mode 100644 team_1/yasin/.empty create mode 100644 team_1/yasin/hackerrank.py create mode 100644 team_1/yasin/homework.py diff --git a/team_1/yasin/.empty b/team_1/yasin/.empty deleted file mode 100644 index e69de29..0000000 diff --git a/team_1/yasin/hackerrank.py b/team_1/yasin/hackerrank.py new file mode 100644 index 0000000..8ec2f37 --- /dev/null +++ b/team_1/yasin/hackerrank.py @@ -0,0 +1,102 @@ +# 1- https://www.hackerrank.com/challenges/python-arithmetic-operators/problem + +# Task +# The provided code stub reads two integers from STDIN, and . Add code to print three lines where: + +# The first line contains the sum of the two numbers. +# The second line contains the difference of the two numbers (first - second). +# The third line contains the product of the two numbers. +# Example + +# Print the following: +# 8 +# -2 +# 15 + +a = int(input()) +b = int(input()) + +print(a+b) +print(a-b) +print(a*b) + + +# 2. https://www.hackerrank.com/challenges/find-second-maximum-number-in-a-list/problem + +arr = list(map(int, input().split())) +arr = list(set(arr)) +arr.sort() +print(arr[-2]) + +# arr = list(map(int, input().split())) : We split the data received from the user by spaces, convert each element to an integer and convert it to a list. +# arr = list(set(arr)) : We used set() to remove duplicate numbers in the list. Set keeps only unique elements. +# arr.sort() : We sorted the list, with the largest element coming last. +# arr[-2] : We get the second largest number, the element before the end of the list. + + + + +# 3- https://www.hackerrank.com/challenges/python-print/problem +list_number =[] +n = int(input("enter a number")) + +for i in range(1, n+1): + list_number.append(i) + +str_number ="".join(map(str, list_number)) +print(str_number) + +# input(): Takes an integer n from the user. +# range(): Generates numbers from 1 to n. +# append(): Adds each number to the list (list_number). +# map(): Converts all list elements to strings. +# join(): Combines the string elements into a single string without spaces. + +# 4- https://www.hackerrank.com/challenges/finding-the-percentage/problem + +n = int(input()) # n sayisi kadar for dongusu calisir. +student_marks = {} +for _ in range(n): + name, *line = input().split() # girdi: "Ali 70 80 90" -> ["Ali", "70", "80", "90"] -> name = "Ali" line = ["70", "80", "90"] + scores = list(map(float, line)) + student_marks[name] = scores +query_name = input() +scores = student_marks[query_name] +average = sum(scores) / len(scores) +print(f"{average:.2f}") # 2 ondalık basamak göstermek için + + +#Girdi Alır: + +#İlk olarak kaç öğrenci olduğunu (n) alır. +#Ardından her bir öğrenci için isim ve notları girdi olarak alır. +#Sözlük Oluşturur: + +#Her öğrencinin ismini bir anahtar (key), notlarını ise bir liste olarak student_marks sözlüğüne ekler. +#Sorgu Çalıştırır: + +#Kullanıcıdan sorgulamak istediği öğrencinin adını alır ve o öğrencinin notlarını bulur. +#Ortalama Hesaplar ve Yazdırır: + +#Notların ortalamasını hesaplar ve sonucu yazdırır. + + +#1- Öğrencileri ve notlarını toplama: +# student_marks[name] = scores +# Bu işlem for döngüsü içinde olur ve her öğrencinin adı (name) ile notları (scores) sözlüğe eklenir. + +#2- Kullanıcının sorgulaması: +# query_name = input() +# scores = student_marks[query_name] + +# Kullanıcıdan bir isim (örneğin "Ali") alırız ve bu ismi kullanarak sözlükten ilgili notlara ulaşırız. + +numbers = ["1", "2", "3", "4"] + +# map fonksiyonu kullanılır +result = map(int, numbers) + +print(result) # Bu bir map object: + +# Listeye çevrildiğinde elemanları görürüz +print(list(result)) # [1, 2, 3, 4] diff --git a/team_1/yasin/homework.py b/team_1/yasin/homework.py new file mode 100644 index 0000000..1c91d77 --- /dev/null +++ b/team_1/yasin/homework.py @@ -0,0 +1,95 @@ +#Question 1: Write a Python code that prints numbers from 1 to 10 on the screen +number= [] +for i in range(1, 11): + number.append(i) + +print(number) # [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] +#********************************************************************************************* + +#Question 3: Write a Python code that receives a start and end value from the user +# and prints all the numbers between these values ​​(including the end value) on the screen. + +list =[] +while True: + number1= int(input("enter first value :")) + number2 = int(input("enter second value :")) + for i in range (number1 +1, number2): + list.append(i) + break +print(list) + +#********************************************************************************************** +#Question 9: +# How to create a combination of loop and conditional statement that +# takes a word input from the user and checks whether that word is a palindrome (the same when read backwards)? +while True: + user_input= input("Enter a word :") + if user_input == ''.join(reversed(user_input)): + print(f"That word is a palindrom..:{user_input} ") + break + else: + print("That word is not a palindrom..!") + +#********************************************************************************************** +#- Question 12: +# Get Midterm and Final grades from a student for any course. +# The sum of 40% of the midterm exam grade and 60% of the final grade will give the year-end average. If the average is below 50, "FAILED" will appear on the screen, and if it is 50 or above, +# "SUCCESSFUL" will be displayed on the screen. This printing process is 4 lessons. and the lessons will be written one after the other. + + +while True: + + midterm_exam = int(input("enter your midterm exam grade :")) + final_exam = int (input ("enter your final exam grade :")) + average = ((midterm_exam * 40)/100 + (final_exam * 60)/100) + if average >= 50: + print(average, "SUCCESSFUL") + break + else: + print("FAILED!!") + + + + + +#************************************************************************************************* +# Question 2: +# Take a number input from the user and write a Python program that prints even numbers up to this number on the screen. +# Do this first with 'for' and then with 'while' loops. + +# with for loops +list1 = [] +number3 = int(input("Enter a number ")) +for i in range(0, number3): + if i % 2 == 0: + list1.append(i) +print(list1) + +# with while loops +number4 = int(input("Enter a number ")) +number5 = 0 +while number5 <= number4: + print(number5) + number5 += 2 + + +#************************************************************************************************* +# Question 4: Get a number from the user and write a Python code that prints whether this number is odd or even. + + + +# ************************************************************************************************ +#Question 6: +# Write a Python code that receives a number from the user and checks whether this number is prime + +prime_number = int(input("Enter a number :")) + +if prime_number > 1: + for i in range(2, prime_number +1): + if prime_number % i != 0: + print(i, "That is not prime number") + continue + else: + print(i, "That is a prime number !!") +else: + print("That is not prime number") \ No newline at end of file From bd26f37ba16618272bdebb333b63e245c8d92ebe Mon Sep 17 00:00:00 2001 From: zehra Date: Mon, 23 Dec 2024 13:34:40 +0100 Subject: [PATCH 03/14] 2,4 ve 8. sorular eklendi --- Week1/Question 4.py | 9 +++++++++ Week1/Question2.py | 13 +++++++++++++ Week1/Question8.py | 7 +++++++ 3 files changed, 29 insertions(+) create mode 100644 Week1/Question 4.py create mode 100644 Week1/Question2.py create mode 100644 Week1/Question8.py diff --git a/Week1/Question 4.py b/Week1/Question 4.py new file mode 100644 index 0000000..e01d6f2 --- /dev/null +++ b/Week1/Question 4.py @@ -0,0 +1,9 @@ +#Question 4: Get a number from the user and write a Python code that prints whether this number is odd or even. + +sayi=int(input("bir sayi degeri giriniz:")) + +if sayi % 2 == 0 : + print("girdiginiz deger cift sayidir") + +else: + print("girdiginiz deger tek sayidir") \ No newline at end of file diff --git a/Week1/Question2.py b/Week1/Question2.py new file mode 100644 index 0000000..b24e62e --- /dev/null +++ b/Week1/Question2.py @@ -0,0 +1,13 @@ +#Question 2: Take a number input from the user and write a Python program that prints even numbers up to this number on the screen. Do this first with 'for' and then with 'while' loops. + +sayi=int(input("bir sayi giriniz:")) + +for i in range(sayi): + if i % 2 == 0 : + print(i,"bir cift sayidir") + +n=0 +while n Date: Fri, 27 Dec 2024 12:14:28 +0100 Subject: [PATCH 04/14] Delete Question8.py --- Week1/Question8.py | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 Week1/Question8.py diff --git a/Week1/Question8.py b/Week1/Question8.py deleted file mode 100644 index 22bb75e..0000000 --- a/Week1/Question8.py +++ /dev/null @@ -1,7 +0,0 @@ -#Question 8: Write a Python code that takes a word from the user and prints the reverse of this word on the screen. - -kelime=input("bir kelime yaziniz:") - -ters_kelime=kelime[::-1] - -print(ters_kelime) \ No newline at end of file From d7cd280359a8962e636209dc5a25b35b7542d290 Mon Sep 17 00:00:00 2001 From: okayzhr Date: Fri, 27 Dec 2024 12:14:37 +0100 Subject: [PATCH 05/14] Delete Question2.py --- Week1/Question2.py | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 Week1/Question2.py diff --git a/Week1/Question2.py b/Week1/Question2.py deleted file mode 100644 index b24e62e..0000000 --- a/Week1/Question2.py +++ /dev/null @@ -1,13 +0,0 @@ -#Question 2: Take a number input from the user and write a Python program that prints even numbers up to this number on the screen. Do this first with 'for' and then with 'while' loops. - -sayi=int(input("bir sayi giriniz:")) - -for i in range(sayi): - if i % 2 == 0 : - print(i,"bir cift sayidir") - -n=0 -while n Date: Fri, 27 Dec 2024 12:14:43 +0100 Subject: [PATCH 06/14] Delete Question 4.py --- Week1/Question 4.py | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 Week1/Question 4.py diff --git a/Week1/Question 4.py b/Week1/Question 4.py deleted file mode 100644 index e01d6f2..0000000 --- a/Week1/Question 4.py +++ /dev/null @@ -1,9 +0,0 @@ -#Question 4: Get a number from the user and write a Python code that prints whether this number is odd or even. - -sayi=int(input("bir sayi degeri giriniz:")) - -if sayi % 2 == 0 : - print("girdiginiz deger cift sayidir") - -else: - print("girdiginiz deger tek sayidir") \ No newline at end of file From 18ba67688cc46404b0aea2a48d8632561e57d2d0 Mon Sep 17 00:00:00 2001 From: okayzhr Date: Fri, 27 Dec 2024 12:14:50 +0100 Subject: [PATCH 07/14] Create homework_week1.py --- Week1/homework_week1.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Week1/homework_week1.py diff --git a/Week1/homework_week1.py b/Week1/homework_week1.py new file mode 100644 index 0000000..a648586 --- /dev/null +++ b/Week1/homework_week1.py @@ -0,0 +1,35 @@ +#Question 2: Take a number input from the user and write a Python program that prints even numbers up to this number on the screen. Do this first with 'for' and then with 'while' loops. + +sayi=int(input("bir sayi giriniz:")) + +for i in range(sayi): + if i % 2 == 0 : + print(i,"bir cift sayidir") + +n=0 +while n Date: Fri, 27 Dec 2024 12:14:59 +0100 Subject: [PATCH 08/14] Create hackerRank.py --- Week1/hackerRank.py | 55 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 Week1/hackerRank.py diff --git a/Week1/hackerRank.py b/Week1/hackerRank.py new file mode 100644 index 0000000..53a37de --- /dev/null +++ b/Week1/hackerRank.py @@ -0,0 +1,55 @@ +#https://www.hackerrank.com/challenges/python-arithmetic-operators/copy-from/414863112 + +if __name__ == '__main__': + a = int(input()) + b = int(input()) + +print(a+b) +print(a-b) +print(a*b) + + +#https://www.hackerrank.com/challenges/find-second-maximum-number-in-a-list/submissions/code/415196918 + +if __name__ == '__main__': + n = int(input()) + arr = map(int, input().split()) + sayi = list(arr) + + sayilar = sorted(set(sayi)) + + print(sayilar[-2]) + + +#https://www.hackerrank.com/challenges/finding-the-percentage/problem + +if __name__ == '__main__': + n = int(input()) + student_marks = {} + for _ in range(n): + name, *line = input().split() + scores = list(map(float, line)) + student_marks[name] = scores + query_name = input() + +toplam = 0 + +for i in student_marks[query_name]: + toplam += i +ort = float(toplam) / len(student_marks[query_name]) + +print(f"{ort:.2f}") + + +#https://www.hackerrank.com/challenges/python-print/problem + +if __name__ == '__main__': + n = int(input()) + + a = [] + b = "" + for i in range(1, n + 1): + a.append(i) + + b = ''.join(map(str, a)) + print(b) \ No newline at end of file From 697ab59dccf1c53767b18e1780256809f63b2442 Mon Sep 17 00:00:00 2001 From: okayzhr Date: Fri, 27 Dec 2024 12:28:24 +0100 Subject: [PATCH 09/14] Delete .empty --- team_1/zehra/.empty | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 team_1/zehra/.empty diff --git a/team_1/zehra/.empty b/team_1/zehra/.empty deleted file mode 100644 index e69de29..0000000 From 3fc6df2d3c36545182b2159219f36ef54f22a16f Mon Sep 17 00:00:00 2001 From: okayzhr Date: Fri, 27 Dec 2024 12:28:58 +0100 Subject: [PATCH 10/14] odev dosyalari team1 e eklendi --- team_1/zehra/hackerRank.py | 55 ++++++++++++++++++++++++++++++++++ team_1/zehra/homework_week1.py | 35 ++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 team_1/zehra/hackerRank.py create mode 100644 team_1/zehra/homework_week1.py diff --git a/team_1/zehra/hackerRank.py b/team_1/zehra/hackerRank.py new file mode 100644 index 0000000..53a37de --- /dev/null +++ b/team_1/zehra/hackerRank.py @@ -0,0 +1,55 @@ +#https://www.hackerrank.com/challenges/python-arithmetic-operators/copy-from/414863112 + +if __name__ == '__main__': + a = int(input()) + b = int(input()) + +print(a+b) +print(a-b) +print(a*b) + + +#https://www.hackerrank.com/challenges/find-second-maximum-number-in-a-list/submissions/code/415196918 + +if __name__ == '__main__': + n = int(input()) + arr = map(int, input().split()) + sayi = list(arr) + + sayilar = sorted(set(sayi)) + + print(sayilar[-2]) + + +#https://www.hackerrank.com/challenges/finding-the-percentage/problem + +if __name__ == '__main__': + n = int(input()) + student_marks = {} + for _ in range(n): + name, *line = input().split() + scores = list(map(float, line)) + student_marks[name] = scores + query_name = input() + +toplam = 0 + +for i in student_marks[query_name]: + toplam += i +ort = float(toplam) / len(student_marks[query_name]) + +print(f"{ort:.2f}") + + +#https://www.hackerrank.com/challenges/python-print/problem + +if __name__ == '__main__': + n = int(input()) + + a = [] + b = "" + for i in range(1, n + 1): + a.append(i) + + b = ''.join(map(str, a)) + print(b) \ No newline at end of file diff --git a/team_1/zehra/homework_week1.py b/team_1/zehra/homework_week1.py new file mode 100644 index 0000000..a648586 --- /dev/null +++ b/team_1/zehra/homework_week1.py @@ -0,0 +1,35 @@ +#Question 2: Take a number input from the user and write a Python program that prints even numbers up to this number on the screen. Do this first with 'for' and then with 'while' loops. + +sayi=int(input("bir sayi giriniz:")) + +for i in range(sayi): + if i % 2 == 0 : + print(i,"bir cift sayidir") + +n=0 +while n Date: Fri, 27 Dec 2024 12:29:25 +0100 Subject: [PATCH 11/14] py dosylari week1 den silindi --- Week1/hackerRank.py | 55 ----------------------------------------- Week1/homework_week1.py | 35 -------------------------- 2 files changed, 90 deletions(-) delete mode 100644 Week1/hackerRank.py delete mode 100644 Week1/homework_week1.py diff --git a/Week1/hackerRank.py b/Week1/hackerRank.py deleted file mode 100644 index 53a37de..0000000 --- a/Week1/hackerRank.py +++ /dev/null @@ -1,55 +0,0 @@ -#https://www.hackerrank.com/challenges/python-arithmetic-operators/copy-from/414863112 - -if __name__ == '__main__': - a = int(input()) - b = int(input()) - -print(a+b) -print(a-b) -print(a*b) - - -#https://www.hackerrank.com/challenges/find-second-maximum-number-in-a-list/submissions/code/415196918 - -if __name__ == '__main__': - n = int(input()) - arr = map(int, input().split()) - sayi = list(arr) - - sayilar = sorted(set(sayi)) - - print(sayilar[-2]) - - -#https://www.hackerrank.com/challenges/finding-the-percentage/problem - -if __name__ == '__main__': - n = int(input()) - student_marks = {} - for _ in range(n): - name, *line = input().split() - scores = list(map(float, line)) - student_marks[name] = scores - query_name = input() - -toplam = 0 - -for i in student_marks[query_name]: - toplam += i -ort = float(toplam) / len(student_marks[query_name]) - -print(f"{ort:.2f}") - - -#https://www.hackerrank.com/challenges/python-print/problem - -if __name__ == '__main__': - n = int(input()) - - a = [] - b = "" - for i in range(1, n + 1): - a.append(i) - - b = ''.join(map(str, a)) - print(b) \ No newline at end of file diff --git a/Week1/homework_week1.py b/Week1/homework_week1.py deleted file mode 100644 index a648586..0000000 --- a/Week1/homework_week1.py +++ /dev/null @@ -1,35 +0,0 @@ -#Question 2: Take a number input from the user and write a Python program that prints even numbers up to this number on the screen. Do this first with 'for' and then with 'while' loops. - -sayi=int(input("bir sayi giriniz:")) - -for i in range(sayi): - if i % 2 == 0 : - print(i,"bir cift sayidir") - -n=0 -while n Date: Fri, 27 Dec 2024 12:49:52 +0100 Subject: [PATCH 12/14] My task is completed. --- team_1/islam/.empty | 0 team_1/islam/homework.py | 156 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 156 insertions(+) delete mode 100644 team_1/islam/.empty create mode 100644 team_1/islam/homework.py diff --git a/team_1/islam/.empty b/team_1/islam/.empty deleted file mode 100644 index e69de29..0000000 diff --git a/team_1/islam/homework.py b/team_1/islam/homework.py new file mode 100644 index 0000000..560982b --- /dev/null +++ b/team_1/islam/homework.py @@ -0,0 +1,156 @@ +# Python_Modul_Week_1 + +# Question 1: Write a Python code that prints numbers from 1 to 10 on the screen. + +# for i in range(1,11): +# print(i) + +# Question 2: Take a number input from the user and write a Python program that prints even numbers up to this number on the screen. Do this first with 'for' and then with 'while' loops. +# For Loop Solution +# number = int(input("Please type a number: ")) + +# for i in range (1, number + 1): +# if i % 2 == 0: +# print(i) + +# While Loop Solution +# number = int(input("Please type a number: ")) + +# i=2 + +# while i <= number: +# print(i) +# i +=2 + +# Question 3: Write a Python code that receives a start and end value from the user and prints all the numbers between these values ​​(including the end value) on the screen. + +# start_number = int(input("Please enter a start number: ")) +# end_number = int(input("Please enter an end number: ")) + +# for i in range(start_number, end_number+1): +# print(i) + +# Question 4: Get a number from the user and write a Python code that prints whether this number is odd or even. + +# number = int(input("Please enter a number to check: ")) + +# if number % 2 ==0: +# print(f"{number} is an even number." ) + +# else: +# print(f"{number} is an odd number.") + +# Question 5: Write a Python program that takes a positive integer input from the user and calculates its factorial. Factorial is the product of all positive integers between a number itself and 1. For example: if the user entered 5, the program should give the following output: Enter a number from the user: 5 Factorial: 120 + +# number = int(input("Please eneter a positive integer: ")) + +# faktorial = 1 +# for i in range(1, number+1): +# faktorial*=i + +# print(faktorial) + + +# Question 6: Write a Python code that receives a number from the user and checks whether this number is prime. + +# pri_number = int(input("Please enter an integer bigger than 1: ")) + +# is_prime = True + +# for n in range(2, pri_number): +# if pri_number % n == 0: +# print(f"{pri_number} is not prime.") +# is_prime = False +# break + +# if is_prime: +# print(f"{pri_number} is prime.") + + + + +# Question 7: How to create a loop that calculates the Fibonacci sequence and returns the result as a list containing numbers up to a certain limit? + +# limit = int(input("Please enter a limit number: ")) + +# fib = [0,1] + +# while True: +# next_number = fib[-1]+fib[-2] +# if next_number>limit: +# break +# fib.append(next_number) +# print(f"The fibonacci squence up to {limit} is {fib}") + +# Question 8: Write a Python code that takes a word from the user and prints the reverse of this word on the screen. + +# word = input("Please write a word to be reversed: ") + +# print(word[::-1]) + +# Question 9: How to create a combination of loop and conditional statement that takes a word input from the user and checks whether that word is a palindrome (the same when read backwards)? + +# first_word = input("Please write a word to check if palindrome: ") + +# rev_word = first_word[::-1] + +# if first_word == rev_word: +# print(f"{first_word} is a polindrome.") +# else: +# print(f"{first_word} is not a polindrome.") + +# Question 10: Write the code that calculates the person's weight index and returns the result as underweight, overweight or overweight according to the index value. (You can look on the internet for the weight index calculation) To do this, ask the user for their weight and height measurements. weight index If it is below 25, it is weak, Between 25-30 is normal, If you are over 30-40, you are overweight. If you are over 40, you are overweight. + +# print("Welcome to Weight Index Calculator") +# weight = float(input("Please enter your weight: ")) +# height = float(input("Please enter your height: ")) + +# weight_index = weight/height**height + +# if weight_index < 18.5: +# print("You are weak.") + +# elif weight_index >= 18.5 and weight_index <= 24.9 : +# print("You are healthy.") + +# elif weight_index >= 25 and weight_index < 29.9: +# print("You are overweight.") + +# else: +# print("You are obese.") +# Question 11: How to write a Python program that finds the largest of three numbers entered by a user? +# print("Enter 3 numbers to find the largest") +# number_1 = int(input("Please enter the first number: ")) +# number_2 = int(input("Please enter the second number: ")) +# number_3 = int(input("Please enter the third number: ")) + +# if number_1 > number_2 and number_1 > number_3: +# print("The first number is the largest.") + +# elif number_2 > number_1 and number_2 > number_3: +# print("The second number is the largest.") + +# elif number_3 > number_1 and number_3 > number_2: +# print("The third number is the largest.") + + + + +# Question 12: Get Midterm and Final grades from a student for any course. The sum of 40% of the midterm exam grade and 60% of the final grade will give the year-end average. If the average is below 50, "FAILED" will appear on the screen, and if it is 50 or above, "SUCCESSFUL" will be displayed on the screen. This printing process is 4 lessons. and the lessons will be written one after the other. +# print("Welcome to Grade Calculator") + +# for i in range(4): +# course_name = input(f"Please enter the name of the course {i+1}: ") +# mid_exam = float(input(f"Please enter your {course_name} midterm exam grade: ")) +# fin_exam = float(input(f"Please enter your {course_name} final exam grade: ")) +# year_average = (mid_exam * 0.4) + (fin_exam * 0.6) + +# print(f"{course_name} average:{year_average}") + +# if year_average < 50: +# print("FAILED") + +# elif year_average >= 50: +# print("SUCCESSFUL") + +# print("-" * 30) \ No newline at end of file From 9bb91f18e66851d5789c0f04a738f7f36c976289 Mon Sep 17 00:00:00 2001 From: Islam Kavas Date: Fri, 27 Dec 2024 13:44:09 +0100 Subject: [PATCH 13/14] Hackerranktasks completed --- team_1/islam/hackerranktasks.py | 45 +++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 team_1/islam/hackerranktasks.py diff --git a/team_1/islam/hackerranktasks.py b/team_1/islam/hackerranktasks.py new file mode 100644 index 0000000..475749d --- /dev/null +++ b/team_1/islam/hackerranktasks.py @@ -0,0 +1,45 @@ + +# Task 1 +a = int(input()) +b = int(input()) + +print(a+b, a-b, a*b, sep ="\n") + +#Task 2 +n = int(input()) +arr = map(int, input().split()) +arr = list(arr) +highest_score = max(arr) +arr = [score for score in arr if score !=highest_score] +runner_up_score=max(arr) + +print(runner_up_score) + +#Task 3 + +n = int(input()) +string = "" +for i in range(1, n+1): + string +=str(i) + +print(string) + +#Task 4 + +def student_average (student_marks, query_name): + for key, value in student_marks.items(): + if key == query_name: + average_score = sum(value)/len(value) + print('{:.2f}'.format(average_score)) + + + + + n = int(input()) + student_marks = {} + for _ in range(n): + name, *line = input().split() + scores = list(map(float, line)) + student_marks[name] = scores + query_name = input() + student_average (student_marks, query_name) \ No newline at end of file From 29ade311d43cd388704e5684d189028f5ff0265c Mon Sep 17 00:00:00 2001 From: haluklevent34 Date: Fri, 27 Dec 2024 19:14:31 +0100 Subject: [PATCH 14/14] my project solitions --- team_1/haluk/.empty | 0 team_1/haluk/hackerrank.py | 29 ++++++++++++++++++++++++ team_1/haluk/homework.py | 45 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) delete mode 100644 team_1/haluk/.empty create mode 100644 team_1/haluk/hackerrank.py create mode 100644 team_1/haluk/homework.py diff --git a/team_1/haluk/.empty b/team_1/haluk/.empty deleted file mode 100644 index e69de29..0000000 diff --git a/team_1/haluk/hackerrank.py b/team_1/haluk/hackerrank.py new file mode 100644 index 0000000..1f2d66b --- /dev/null +++ b/team_1/haluk/hackerrank.py @@ -0,0 +1,29 @@ +# Arithmetic Operators + +a = int(input()) + b = int(input()) + print(a+b) + print(a-b) + print(a*b) + + +# Find Second Maximum Number in a List + + n = int(input()) + arr = map(int, input().split()) + arr= list(set(arr)) + arr.remove(max(arr)) + print(max(arr)) + + +# Print Function + +n = int(input()) + rakamlar=[] + for sayi in range(n+1): + rakamlar.append(sayi) + rakamlar.remove(rakamlar[0]) + print(''.join(map(str,rakamlar))) + + +# Finding the Percentage \ No newline at end of file diff --git a/team_1/haluk/homework.py b/team_1/haluk/homework.py new file mode 100644 index 0000000..1c5e8fc --- /dev/null +++ b/team_1/haluk/homework.py @@ -0,0 +1,45 @@ +# 6- Write a Python code that receives a number from the user and checks whether this number is PRIME. + +sayi=int(input('\nBir sayi giriniz :')) +def is_prime(sayi): + if sayi <= 1: + return False + for i in range(2, sayi): + if sayi % i == 0: + return False + return True +if is_prime(sayi): + print(sayi,'bir asal sayidir.') +else: + print(sayi,'bir asal sayi degildir.') + + + + + + +# 7- How to create a loop that calculates the Fibonacci sequence and returns the result as a list containing numbers up to a certain limit? + +limit = int(input("\nFibonacci dizisi için bir limit giriniz: ")) + +fib_list = [0, 1] +while fib_list[-1] + fib_list[-2] <= limit: + fib_list.append(fib_list[-1] + fib_list[-2]) +print('\nGirdiginiz sayiya kadar Fibonacci dizisi su sekildedir ;\n',fib_list) + + + + +# 11- How to write a Python program that finds the largest of three numbers entered by a user? + +sayi1 = int(input("\nBirinci sayiyi giriniz: ")) +sayi2 = int(input("Ikinci sayiyi giriniz: ")) +sayi3 = int(input("Ucuncu sayiyi giriniz: ")) + +if sayi1 >= sayi2 and sayi1 >= sayi3: + buyuk = sayi1 +elif sayi2 >= sayi1 and sayi2 >= sayi3: + buyuk = sayi2 +else: + buyuk = sayi3 +print('\nEn buyuk sayi :',buyuk) \ No newline at end of file