Python end parameter in print()

Configurare noua (How To)

Situatie

By default python’s print() function ends with a newline.

Python’s print() function comes with a parameter called ‘end’.

You can end a print statement with any character/string using this parameter.

Solutie

Pasi de urmat

print(“A” , end = ‘ ‘)
print(“Test”, end = ‘ ‘)

Output:

A Test

print(“email” , end = ‘@’)
print(“domain”)

Output:

email@domain

Tip solutie

Permanent

Voteaza

(21 din 39 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?