HackerRank Text Alignment problem solution in Python | python problem solution

In Python, a string of text can be aligned left, right and center..ljust(width)This method returns a left aligned string of length width.>>> width = 20>>> print 'HackerRank'.ljust(width,'-')HackerRank---------- .center(width)This method returns a centered string of…

Continue ReadingHackerRank Text Alignment problem solution in Python | python problem solution

HackerRank String validators problem solution in python | python problem solution

Python has built-in string validation methods for basic data. It can check if a string is composed of alphabetical characters, alphanumeric characters, digits, etc.str.isalnum()This method checks if all the characters…

Continue ReadingHackerRank String validators problem solution in python | python problem solution

Hackerrank Mutations problem solution in Python | python problem solution

Hackerrank Mutations problem solution in Python | python problem solution Read a given string, change the character at a given index and then print the modified string. Problem solution in Python 3 programming.

Continue ReadingHackerrank Mutations problem solution in Python | python problem solution

HackerRank sWAP cASE problem solution in python | python problem solution

 You are given a string and your task is to swap cases. In other words, convert all lowercase letters to uppercase letters and vice versa.For Example:Www.HackerRank.com → wWW.hACKERrANK.COMPythonist 2 → pYTHONIST…

Continue ReadingHackerRank sWAP cASE problem solution in python | python problem solution

HackerRank Tuples problem solution in python | python Question Solution

 TaskGiven an integer, , and  space-separated integers as input, create a tuple, , of those  integers. Then compute and print the result of .Note: hash() is one of the functions in the __builtins__ module, so it need not be…

Continue ReadingHackerRank Tuples problem solution in python | python Question Solution

HackerRank Lists problem solution in python | python lists problem

Consider a list (list = []). You can perform the following commands:insert i e: Insert integer  at position .print: Print the list.remove e: Delete the first occurrence of integer .append e: Insert integer  at…

Continue ReadingHackerRank Lists problem solution in python | python lists problem

HackerRank Finding the percentage solution in python | hacker rank interview Question solution

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…

Continue ReadingHackerRank Finding the percentage solution in python | hacker rank interview Question solution

HackerRank Find the Runner Up Score solution in python | Python Question Solution

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…

Continue ReadingHackerRank Find the Runner Up Score solution in python | Python Question Solution