Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python f' meaning

The f or F in front of strings tells Python to look at the values inside {} and substitute them with the values of the variables if exist.
Example:
agent = 'James Bond'
num = 9

# old ways
print('{0} has {1} number '.format(agent, num))

# f-strings way
print(f'{agent} has {num} number')
 
PREVIOUS NEXT
Tagged: #python #meaning
ADD COMMENT
Topic
Name
3+1 =