Answers for "what is a string in python"

3

how to create a string in python

var1 = "A String"
Posted by: Guest on March-08-2020
2

define a string in python

string1 = "something"
string2 = 'something else'
string3 = """
something
super
long
"""
Posted by: Guest on December-04-2020
0

python string

#Strings in python are surrounded by either single quotation marks, or double quotation marks.
print("This is a string")
print('i am also a string')
Posted by: Guest on June-30-2021
0

python string tutorial

print("Hellonworld") #for a new line "n"
print("I want to type "Hello world" but I can't") #for writing characters used in coding

phrase = "Hello World" #assigning a value
print(phrase) #for printing values

print(phrase.upper()) #for changing the string to upper case. 
# If you change "upper" out with "lower" it will changing the string to lower case.

print(len(phrase)) # printing the length of the string

print(phrase[0]) # giving the first letter of the string
# 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10

print(phrase.index("e")) # printing where in the string "e" is
print(phrase.index("llo"))# printing where in the string "llo" is
Posted by: Guest on November-21-2020
-2

python string

print("Hello")

print('Hello')
Posted by: Guest on May-27-2021

Python Answers by Framework

Browse Popular Code Answers by Language