From 2bbc348218765c08b8b4566085775b66badf78b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luiz=20Ot=C3=A1vio?= Date: Tue, 25 Oct 2022 11:14:19 -0300 Subject: [PATCH] =?UTF-8?q?Formata=C3=A7=C3=A3o=20de=20strings=20com=20o?= =?UTF-8?q?=20m=C3=A9todo=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aula14.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 aula14.py diff --git a/aula14.py b/aula14.py new file mode 100644 index 0000000..2eaf712 --- /dev/null +++ b/aula14.py @@ -0,0 +1,9 @@ +a = 'AAAAA' +b = 'BBBBBB' +c = 1.1 +string = 'b={nome2} a={nome1} a={nome1} c={nome3:.2f}' +formato = string.format( + nome1=a, nome2=b, nome3=c +) + +print(formato)