Tech > Coding Challenges > HackerRank > Prepare > Python > Basic Data Types > Finding the Percentage

Problem Link to the original HackerRank problem The provided code stub will read in a dictionary containing key/value pairs of name:[marks] for a list of students. Print the average of the marks array for the student name provided, showing 2 places after the decimal. Example marks key:value pairs are 'alpha': [20, 30, 40] 'beta': [30, 50, 70] query_name = 'beta' The query_name is ‘beta’. Beta’s average score is (30 + 50 + 70) /3 = 50.0. ...

January 26, 2024 · 2 min · 285 words

Tech > Coding Challenges > HackerRank > Prepare > Python > Basic Data Types > Nested Lists

Problem Link to the original HackerRank problem Given the names and grades for each student in a class of N students, store them in a nested list and print the name(s) of any student(s) having the second lowest grade. Note: If there are mutliple students with the second lowest grade, order their names aphabetically and print each name on a new line. Example records = [["chi", 20.0], ["beta", 50.0], ["alpha", 50.0]] ...

January 22, 2024 · 4 min · 671 words

Tech > Coding Challenges > HackerRank > Prepare > Python > Basic Data Types > Find the Runner-Up Score!

Problem Link to the original HackerRank problem Given the participants’ score sheet for your University Sports Day, you are required to find the runner-up score. You are given n scores. Store them in a list and find the score of the runner-up. Input Format The first line contains n. The second line contains an array A[] of n integers each separated by a space. Constraints 2 <= n <= 10 -100 <= A[i] <= 100 Output Format ...

January 20, 2024 · 3 min · 497 words