Answers for "how to replace variable in string in python"

1

python string replace variable

var = '{foo} {foo} {foo}'.format(foo = 'python you so crazy')
Posted by: Guest on December-07-2021
1

how to replace string in python

text = "python is too difficult , I have a good experience with it"
#python is too difficult I am using this text for example only
print(text.replace('difficult', 'easy'))
#####output#####
#python is too easy , I have a good experience with it
Posted by: Guest on October-12-2021

Code answers related to "how to replace variable in string in python"

Python Answers by Framework

Browse Popular Code Answers by Language