pub-3785248829033902 | Python: Print two sentences | - Big data with Python

| Python: Print two sentences |

Many languages arrange code into blocks using curly braces ({ and }) or BEGIN and END statements – these languages encourage us to indent blocks to make code easier to read, but indentation is not compulsory.

Python uses indentation only to delimit blocks, so we must indent our code.



The best way to learn new things is to take a practical approach of the things you want to learn. Here is a fragment of code that demonstrates the use of statements with texts in Python:

Æ’ python command

def t(text):
    text = text + 'fish and chips'
    return text
print(t('I want '))

output

I want fish and chips  


Previous
Next Post »