Answers for "how to declare variable as string in python"

1

python string variable

# Python string variable

mystring = 'This is a string!'

print(mystring)
Posted by: Guest on September-16-2021
17

variable in python

variable1 = "value" # string
variable2 = 1000000 # integer
variable3 = 10000.0 # real/float
variable4 = True # boolean: True or False
Posted by: Guest on March-15-2020
0

variable string in string python

>>> shepherd = "Mary"
>>> age = 32
>>> stuff_in_string = "Shepherd {} is {} years old.".format(shepherd, age)
>>> print(stuff_in_string)
Shepherd Mary is 32 years old.
Posted by: Guest on July-24-2020

Code answers related to "how to declare variable as string in python"

Python Answers by Framework

Browse Popular Code Answers by Language