Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save OpnSrcConstruction/657e81acd884b711c548e1f5d9090168 to your computer and use it in GitHub Desktop.
Save OpnSrcConstruction/657e81acd884b711c548e1f5d9090168 to your computer and use it in GitHub Desktop.
Python beginer examples: string Trix #python #string #indexing
'''
@author: OpnSrcConstruction
'''
# A string is just a list of string objects in Python.
# This is much simpler, than all those strict languages like C.
string_greeting = "Hello World!"
programming_community = "Python Programming"
# Print entire String.
print(string_greeting)
# Prints a blank line.
Print("\n")
# Print SubString from string_greeting.
print(string_greeting[0:] , string_greeting[0])
print(programming_community[1:6], "\n" "programming_community[1:6]")
# OUTPUT:
#
# Hello World!
#
# Hello H
#
# Python
# programming_community[1:6]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment