Upcoming technologies, programming, problem solving, coding, technology, mobile phones
About us
Get link
Facebook
Twitter
Pinterest
Email
Other Apps
In this blog you will be able to learn python-programming language and problem solving. You can also find solutions for hackerrank problems, google coding problems.
Solution for hackerRank problem Finding the percentage in python 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 The query_name is 'beta'. beta's average score is . Input Format The first line contains the integer , the number of students' records. The next lines contain the names and marks obtained by a student, each value separated by a space. The final line contains query_name , the name of a student to query. Constraints 2<=n<=10 0<=marks[i]<=100 length of marks arrays = 3 Output Format Print one line: The average of the marks obtained by the particular student correct to 2 decimal places. Sample Input 0 3 Krishna 67 68 69 Arjun 70 98 63 Malika 52 56 60 Malika Sample Output 0 56.00 Explanation 0 Explanation 0 Marks for Malika are whose average is Sample Input
1. Rearrangement Given a list A elements of length n , ranging from 1 to n. All elements may not be present in the array. If the element is not present then there will be -1 present in the array. Rearrange the array such that A[i]=i and if i is not present display -1 at that place. Input format : The first line contains a n numbers with each number separated by space. Output format : Print the elements of the list after modification. Sample input : -1 -1 6 1 9 3 2 -1 4 -1 Sample Output : -1 1 2 3 4 -1 6 -1 -1 9 Explanation : The modified list contains elements such that A[i]=i . Code : Output : 2. Formula Write a program that calculates and prints the value according to the given formula , Q=square root of [(2*C*D)/H]. Following are the fixed values of C and H , C=50 ,H=30. D is the variable whose values should be input to your program in a comma separated sequence. Input format : A sequence of values for D with each value separated by comma. Output format : Print the sequence of
Solution for hackerRank problems What's your name, Tuple in Python. 1. What's your name You are given the first name and lastname of a person on two different lines. Your task is to read them and print the following: "Hello firstname lastname! You just delved into python." Function Description Complete the print_full_name function in the editor below. print_full_name has the following parameters: string first: the first name string last: the last name Prints string: 'Hello firstname lastname! You just delved into python' where firstname and lastname are replaced with first and last. Input Format The first line contains the first name, and the second line contains the last name. Constraints The length of the first and last names are each ≤ . Sample Input 0 Ross Taylor Sample Output 0 Hello Ross Taylor! You just delved into python. Explanation 0 The input read by the program is stored as a string data type. A string is a collection of characters. Procedu
Comments
Post a Comment