• Kurse
  • Code Compiler
  • Diskutieren
  • Preise
  • Teams
Menu
+ 1

What is the deference between using format() function and using these %s , %d ...

print ('{0}'.format('a')) . . print ('%s' % ('b')) ?

python#stringsformat()#functions#%d
12th May 2021, 8:19 PM
Safou Abderrahim
Safou Abderrahim - avatar
2 Antworten
+ 2
1. https://www.quora.com/What-are-the-differences-among-s-r-and-d-in-JUMP_LINK__&&__Python__&&__JUMP_LINK 2. https://www.edureka.co/community/47833/difference-between-s-and-d-in-python-string-formatting 3. https://www.udacity.com/blog/2020/11/python-string-format-whats-the-difference-between-s-and-d.html 4. https://www.geeksforgeeks.org/difference-between-s-and-d-in-python-string/ 5. https://www.geeksforgeeks.org/python-format-function/ https://stackoverflow.com/questions/4288973/whats-the-difference-between-s-and-d-in-python-string-formatting
13th May 2021, 3:07 AM
NEZ
NEZ - avatar
+ 1
%s is used for string and %d is used for integer.....looks like you are working with python....if i am correct then you dont need %s or %d ....you can do anything without them....
12th May 2021, 10:11 PM
Md. Mursalatul Islam Pallob
Md. Mursalatul Islam Pallob - avatar

Häufig solche Fragen?

Effizienter lernen, kostenlos:

  • Einführung in Python

    7.1M Lernende

  • Einführung in Java

    4.7M Lernende

  • Einführung in C

    1.5M Lernende

  • Einführung in HTML

    7.5M Lernende

Alle Kurse anzeigen
Heute heiß
I need help to solve this
0 Votes
Engineer Cloud
0 Votes
How to add comment in python?
0 Votes
Lua?
1 Votes
How do we code calculator
1 Votes
Ayuda para insertar la imagen de portada y las melodías a mi álbum alguien sabe cómo
0 Votes