Computer Code Python CCP 13 : les chaînes de caractères, le retour
1 Justification
print('Salut'.rjust(10)) print('Salut'.rjust(20)) print('Salut le monde'.rjust(20)) print('Salut'.ljust(10)) print('Salut'.rjust(20, '*')) print('Salut'.ljust(20, '-')) print('Salut'.center(20)) print('Salut'.center(20, '='))
2 Retrait des espaces
test = ' Salut le monde ' print(test) print(test.strip()) print(test.lstrip()) print(test.rstrip())
3 Presse-papier python
import pyperclip pyperclip.copy('Salut le monde !') print(pyperclip.paste()) print(pyperclip.paste())
4 Bilan
Nous avons vu dans ce cours :
- Comment justifier le texte
- Comment retirer des espaces
- Comment utiliser le presse-papier
5 Pour aller plus loin
- La vidéo sur YouTube : https://youtu.be/uSf0BHnNZJs
- La version Markdown sur Steemit : https://steemit.com/fr/@lgsp/computer-code-python-ccp-13-les-chaines-de-caracteres-le-retour
- La formation pour apprendre à coder une blockchain avec Python : ACBP
- La formation pour découvrir les technologies blockchain : CDBSSR
- La formation pour devenir full stack developer : FSD
- Le pack avec un paiement en 10 fois : https://glmp.systeme.io/pack-3-formations-10-fois