Posts

"Delete every third character: Given a string. Delete from it all the characters whose indices are divisible by 3" - Snakify python coding question

"Replace within the fragment: Given a string. Replace every occurrence of the letter h by the letter H, except for the first and the last ones. " - Snakify python coding question

"Delete a character: Given a string. Remove from this string all the characters @. " - Snakify python coding question

"Replace the substring: Given a string. Replace in this string all the numbers 1 by the word one." - Snakify python coding question

"Reverse the fragment: Given a string in which the letter h occurs at least two times, reverse the sequence of characters enclosed between the first and last appearances. " - Snakify python coding question

"Remove the fragment: Given a string in which the letter h occurs at least twice. Remove from that string the first and the last occurrence of the letter h, as well as all the characters between them " - Snakify python coding question

"The second occurrence: Given a string that may or may not contain the letter of interest. Print the index location of the second occurrence of the letter f. If the string contains the letter f only once, then print -1, and if the string does not contain the letter f, then print -2." - Snakify python coding question

"The first and last occurrence: Given a string that may or may not contain a letter of interest. Print the index location of the first and last appearance of f. If the letter f occurs only once, then output its index. If the letter f does not occur, then do not print anything. Don't use loops in this task. " - Snakify python coding question

"To swap the two words: Given a string consisting of exactly two words separated by a space. Print a new string with the first and second word positions swapped (the second word is printed first). This task should not use loops and if. " - Snakify python coding question

"The two halves: Given a string. Cut it into two "equal" parts (If the length of the string is odd, place the center character in the first string, so that the first string contains one more characther than the second). Now print a new string on a single row with the first and second halfs interchanged (second half first and the first half second) " - Snakify python coding question

"The number of words: Given a string consisting of words separated by spaces. Determine how many words it has. To solve the problem, use the method count. " - Snakify python coding question

"Slices: You are given a string. In the first line, print the third character of this string. In the second line, print the second to last character of this string. In the third line, print the first five characters of this string. " - Snakify python coding question

"Lost card: There was a set of cards with numbers from 1 to N. One of the card is now lost. Determine the number on that lost card given the numbers for the remaining cards. " - Snakify python coding question

"Ladder: For given integer n ≤ 9 print a ladder of n steps. The k-th step consists of the integers from 1 to k without spaces between them. " - Snakify python coding question

"Adding factorials: Given an integer n, print the sum 1!+2!+3!+...+n!." - Snakify python coding question

"The number of zeros: Given N numbers: the first number in the input is N, after that N integers are given. Count the number of zeros among the given integers and print it." - Snakify python coding question

"Factorial: In mathematics, the factorial of an integer n, denoted by n! is the following product: n!=1×2×…×n " - Snakify python coding question

"Sum of cubes: For the given integer N calculate the following sum: 1^3+2^3+…+N^3" - Snakify python coding question

"Sum of N numbers: N numbers are given in the input. Read them and print their sum. " - Snackify python coding question

"Sum of ten numbers: 10 numbers are given in the input. Read them and print their sum. Use as few variables as you can. " - Snackify python coding question

"Series - 2: Given two integers A and B. Print all numbers from A to B inclusively, in ascending order, if A < B, or in descending order, if A ≥ B. " - Snackify python coding question

"Series - 1 : Given two integers A and B (A ≤ B). Print all numbers from A to B inclusively. " - Snackify python coding question

"Leap year: Given the year number. You need to check if this year is a leap year. If it is, print LEAP, otherwise print COMMON. " - Snackify python coding question

"Chocolate bar: Chocolate bar has the form of a rectangle divided into n×m portions. Chocolate bar can be split into two rectangular parts by breaking it along a selected straight line on its pattern. Determine whether it is possible to split it so that one of the parts will have exactly k squares." - Snackify python coding question

"Knight move: Chess knight moves like the letter L. It can move two cells horizontally and one cell vertically, or two cells vertically and one cells horizontally. Given two different cells of the chessboard, determine whether a knight can go from the first cell to the second in one move" - Snackify python coding question

"Queen move: Chess queen moves horizontally, vertically or diagonally to any number of cells. Given two different cells of the chessboard, determine whether a queen can go from the first cell to the second in one move." - Snackify python coding question

"Bishop moves: In chess, the bishop moves diagonally, any number of squares. Given two different squares of the chessboard, determine whether a bishop can go from the first to the second in one move. " - Snackify python coding question

"King move : Chess king moves horizontally, vertically or diagonally to any adjacent cell. Given two different cells of the chessboard, determine whether a king can go from the first cell to the second in one move." - Snackify python coding question

"Chess board - same color: Given two cells of a chessboard. If they are painted in one color, print the word YES, and if in a different color - NO" - Snackify python coding question

"Rook move: Chess rook moves horizontally or vertically. Given two different cells of the chessboard, determine whether a rook can go from the first cell to the second in one move." - Snackify python coding question

"Equal numbers: Given three integers, determine how many of them are equal to each other. The program must print one of these numbers: 3 (if all are the same), 2 (if two of them are equal to each other and the third is different) or 0 (if all numbers are different). " - Python coding question

"Minimum of three numbers: Given three integers, print the smallest value. " - Python coding question

"Sign function : For the given integer X print 1 if it's positive, -1 if it's negative, or 0 if it's equal to zero. Try to use the cascade if-elif-else for it. " - Python coding question

"Minimum of two numbers : Given two integers, print the smaller value." - Python coding question

"Clock face - 2: Hour hand turned by α degrees since the midnight. Determine the angle by which minute hand turned since the start of the current hour. Input and output in this problems are floating-point numbers. " - Python coding question

"Clock face - 1: H hours, M minutes and S seconds are passed since the midnight (0 ≤ H < 12, 0 ≤ M < 60, 0 ≤ S < 60). Determine the angle (in degrees) of the hour hand on the clock face right now. " - Python coding question

"Total cost: A cupcake costs A dollars and B cents. Determine, how many dollars and cents should one pay for N cupcakes. A program gets three numbers: A, B, N. It should print two numbers: total cost in dollars and cents." - Python coding question

"Digital clock: Given the integer N - the number of minutes that is passed since midnight - how many hours and minutes are displayed on the 24h digital clock? " - Snackify python coding question

"Car route: A car can cover distance of N kilometers per day. How many days will it take to cover a route of length M kilometers? The program gets two numbers: N and M." - python coding question

"Question" - Python coding question

"Fractional part : Given a positive real number, print its fractional part." - python coding question

"Sum of digits : Given a three-digit number. Find the sum of its digits." - python coding question

"Ten digit: Given an integer. Print its tens digit." - Snackify python coding question

Last digit of integer : Given an integer number, print its last digit, Snackify.org python code