how to create string in python
string = "this is string"
#or
string = 'this is also string'
how to create string in python
string = "this is string"
#or
string = 'this is also string'
variable in python
variable1 = "value" # string
variable2 = 1000000 # integer
variable3 = 10000.0 # real/float
variable4 = True # boolean: True or False
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
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us