Answers for "how to use %s python"

48

formatted string python

# Newer f-string format
name = "Foo"
age = 12
print(f"Hello, My name is {name} and I'm {age} years old.")
# output :
# Hello, my name is Foo and I'm 12 years old.
Posted by: Guest on March-27-2020
4

how to use %s python

'%s is the true joke' % args
Posted by: Guest on May-18-2021
2

%s in python

a = "some text"
print("%s < the string has been added here" % a)
# OUTPUT: some text < the string has been added here
Posted by: Guest on July-21-2021
3

String Formatting with the % Operator

>>> name = 'Bob'
>>> 'Hello, %s' % name
"Hello, Bob"
Posted by: Guest on November-25-2019

Python Answers by Framework

Browse Popular Code Answers by Language