Hackerrank python

itertools.product() Hackerrank Python Solution

itertools.product() This tool computes the cartesian product of input iterables. It is equivalent to nested for-loops. For example, product(A, B) re…

Merge the Tools! Python Hackerrank solution

Problem: Consider the following problem: You are given a string s and an integer k. Split s into n/k subsegments where each subsegment contains k cha…

The Minion Game Python Hackerrank solution

Kevin and Stuart want to play the ' The Minion Game '. Game Rules Both players are given the same string,S. Both players have to make substri…

Capitalize! Python Hackerrank solution

You are asked to ensure that the first and last names of people begin with a capital letter in their passports. For example, alison heck should be ca…

Alphabet Rangoli Python Hackerrank solution

You are given an integer,N. Your task is to print an alphabet rangoli of size N. (Rangoli is a form of Indian folk art based on creation of patterns.…

String Formatting Python Hackerrank solution

Given an integer,n, print the following values for each integer i from 1 to n: Decimal Octal Hexadecimal (capitalized) Binary Function Description Co…

Designer Door Mat HackerRank python Solution

Mr. Vincent works in a door mat manufacturing company. One day, he designed a new door mat with the following specifications: Mat size must be N X M.…

Text Wrap HackerRank python Solution

You are given a string S and width W. Your task is to wrap the string into a paragraph of width W. Function Description Complete the wrap function in…

Text Alignment HackerRank python 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. >>&…

String Validators HackerRank python Solution

Python has built-in string validation methods for basic data. It can check if a string is composed of alphabetical characters, alphanumeric character…

Find a string HackerRank python Solution

Problem In this challenge, the user enters a string and a substring. You have to print the number of times that the substring occurs in the given str…

Mutations HackerRank python Solution

Problem We have seen that lists are mutable (they can be changed), and tuples are immutable (they cannot be changed). Let's try to understand thi…

What's Your Name? HackerRank python Solution

Problem You are given the firstname and lastname of a person on two different lines. Your task is to read them and print the following: Hello fir…

String Split and Join HackerRank python Solution

In Python, a string can be split on a delimiter. Example: >>> a = "this is a string" >>> a = a.split(" ") # a …

sWAP cASE HackerRank python 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…

Tuples HackerRank python Solution

Task Given an integer,n, and n space-separated integers as input, create a tuple,t, of those n integers. Then compute and print the result of hash(t)…

Lists HackerRank python Solution

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

Finding the percentage HackerRank python 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 ar…

Nested Lists HackerRank python Solution pypy2 + pypy3

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 …

Find the Runner-Up Score! Python Hackerrank 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 t…
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.