Python From Scratch: Website - Linkedin - Youtube
Python From Scratch: Website - Linkedin - Youtube
Website - https://petroleumfromscratchin.wordpress.com/
LinkedIn - https://www.linkedin.com/company/petroleum-from-scratch
YouTube - https://www.youtube.com/channel/UC_lT10npISN5V32HDLAklsw
We use string formatting because it is lot easier than just simply using concatenation
/
1/28/2021 Python for O&G Lecture 6 - String Formatting - Colaboratory
# Python 3
print('Reservoir pressure is {} psi'.format(press)) # does not matter that press is an integer value
# Python 3.6
# ugly method
print('Reservoir pressure in' + ' ' + field + 'is' + ' ' + str(press) + ' ' + 'psi')
# python 3 method
# python 3 method
/
1/28/2021 Python for O&G Lecture 6 - String Formatting - Colaboratory