Giter Club home page Giter Club logo

ganeshkavhar / string-in-python-by-ganesh-kavhar Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 3 KB

ganesh kavhar python programming assignment

Home Page: https://ganeshmkavhar.000webhostapp.com/

Python 100.00%
python data-science data-visualization software-development machine-learning machienlearning ganeshkavhar ganeshkavharpythontutorials ganeshkavharprojects ganeshkavharpythonarticles ganeshkavharpypi ganeshkavhargithub ganeshkavharwebsite ganeshkavharapps ganeshkavhartutorial string pythonprograms learning-by-doing learnpython

string-in-python-by-ganesh-kavhar's Introduction

String-in-python-by-ganesh-kavhar

ganesh kavhar python programming assignment

Strings are amongst the most popular types in Python. We can create them simply by enclosing characters in quotes. Python treats single quotes the same as double quotes. Creating strings is as simple as assigning a value to a variable. For example −

var1 = 'Hello World!' var2 = "Python Programming" Accessing Values in Strings Python does not support a character type; these are treated as strings of length one, thus also considered a substring.

To access substrings, use the square brackets for slicing along with the index or indices to obtain your substring. For example − #!/usr/bin/python

var1 = 'Hello World!' var2 = "Python Programming"

print "var1[0]: ", var1[0] print "var2[1:5]: ", var2[1:5] When the above code is executed, it produces the following result −

var1[0]: H var2[1:5]: ytho Updating Strings You can "update" an existing string by (re)assigning a variable to another string. The new value can be related to its previous value or to a completely different string altogether. For example − #!/usr/bin/python

var1 = 'Hello World!' print "Updated String :- ", var1[:6] + 'Python'

string-in-python-by-ganesh-kavhar's People

Contributors

ganeshkavhar avatar

Watchers

 avatar  avatar  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.