Yahoo India Web Search

Search results

  1. Dec 9, 2020 · Basic String Programs. Python program to check whether the string is Symmetrical or Palindrome. Reverse words in a given String in Python. Ways to remove i’th character from string in Python. Find length of a string in python (4 ways) Python – Avoid Spaces in string length. Python program to print even length words in a string.

    • Exercise 1A: Create A String Made of The First, Middle and Last Character
    • Exercise 1B: Create A String Made of The Middle Three Characters
    • Exercise 2: Append New String in The Middle of A Given String
    • Exercise 6: Create A Mixed String Using The Following Rules
    • Exercise 7: String Characters Balance Test
    • Exercise 9: Calculate The Sum and Average of The Digits Present in A String
    • Exercise 12: Find The Last Position of A Given Substring
    • Exercise 13: Split A String on Hyphens
    • Exercise 17: Find Words with Both Alphabets and Numbers

    Write a program to create a new string made of an input string’s first, middle, and last character. Given: Expected Output:

    Write a program to create a new string made of the middle three characters of an input string. Given:

    Given two strings, s1 and s2. Write a program to create a new string s3 by appending s2 in the middle of s1. Given: Expected Output:

    Given two strings, s1 and s2. Write a program to create a new string s3 made of the first char of s1, then the last char of s2, Next, the second char of s1 and second last char of s2, and so on. Any leftover chars go at the end of the result. Given: Expected Output:

    Write a program to check if two strings are balanced. For example, strings s1 and s2 are balanced if all the characters in the s1 are present in s2. The character’s position doesn’t matter. Given:

    Given a string s1, write a program to return the sum and average of the digits that appear in the string, ignoring all other characters. Given: Expected Outcome:

    Write a program to find the last position of a substring “Emma” in a given string. Given: Expected Output:

    Write a program to split a given string on hyphens and display each substring. Given: Expected Output:

    Write a program to find words with both alphabets and numbers from an input string. Given: Expected Output:

  2. Oct 22, 2021 · Q1. What is String in Python? Show Answer. Q2. Is there any difference in ‘a’ or “a” in python? Show Answer. Q3. Is there any difference between 1 or ‘1’ in python? Show Answer. Q4. Python treats single quotes same as double quotes. (T/F) Show Answer. Q5. A string with zero character is called __________ string. Show Answer. Q6.

    • Write a Python program to calculate the length of a string. Click me to see the sample solution.
    • Write a Python program to count the number of characters (character frequency) in a string. Sample String : google.com' Expected Result : {'g': 2, 'o': 3, 'l': 1, 'e': 1, '.'
    • Write a Python program to get a string made of the first 2 and last 2 characters of a given string. If the string length is less than 2, return the empty string instead.
    • Write a Python program to get a string from a given string where all occurrences of its first char have been changed to '$', except the first char itself.
  3. Apr 29, 2024 · Boost your Python string skills with hands-on practice problems! Improve your Python game with curated string exercises from our courses.

  4. Jan 21, 2024 · 50 Interview Questions on Python Strings. Basic Concepts. 1. What is a string in Python? A string in Python is a sequence of characters. It is an immutable data type, meaning once a string is...

  5. People also ask

  6. Feb 24, 2024 · This Python String quiz provides Multiple Choice Questions(MCQ) to get familiar with Python String. To perform any programming tasks in Python, a good understanding of string manipulation is necessary. This online quiz focuses on testing your skills in Python String manipulation.