From 5e3d7a17be5464b8bf1f17e763f1be2aa6d2757c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luiz=20Ot=C3=A1vio?= Date: Wed, 26 Oct 2022 10:45:56 -0300 Subject: [PATCH] =?UTF-8?q?Interpola=C3=A7=C3=A3o=20de=20string=20com=20%?= =?UTF-8?q?=20em=20Python?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aula25.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 aula25.py diff --git a/aula25.py b/aula25.py new file mode 100644 index 0000000..a9e5291 --- /dev/null +++ b/aula25.py @@ -0,0 +1,12 @@ +""" +Interpolação básica de strings +s - string +d e i - int +f - float +x e X - Hexadecimal (ABCDEF0123456789) +""" +nome = 'Luiz' +preco = 1000.95897643 +variavel = '%s, o preço é R$%.2f' % (nome, preco) +print(variavel) +print('O hexadecimal de %d é %08X' % (1500, 1500))