GithubHelp home page GithubHelp logo

curly-eureka's Introduction

Strings

Write Python programs for the following:

1.To accept a filename from the user and print the extension.

2.Given a string of odd length greater than 7, return a string made of the middle three chars of the given string. Sample String = "Pythonstrings" Expected Result: 'nst'

3.Count all lower case, upper case, digits, and special symbols from a given string. Given String: str1 = "P@#yn26at^&i5ve" Expected Output: Total counts of chars, digits,and symbols Chars = 8 Digits = 3 Symbol = 4

4.To find the longest and the smallest word in a string.

5.To check if a given string is a Palindrome. (A palindrome reads same from front and back. e.g. Madam, Bob, level.) 6. To generate a new string from a given one where all occurrences of its first char are replaced by '$', except the first char itself. Sample String: 'onion' Expected Result: 'oni$n. Sample String: ' people of philippines' Expected Result: ' peo$le of $hili$$ines'

7.To add 'ing' at the end of a given string (length should be at least 3). If the given one already ends with 'ing' then add 'ly' instead. If the string length of the given string is less than 3, leave it unchanged. Sample String: 'sky'. Expected Result: 'skying'. Sample String: 'being'. Expected Result: 'beingly'. Sample String: 'in'. Expected Result: 'in'.

curly-eureka's People

Contributors

parvathy-vijayan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.