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

"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