F Strings : Inuitive way to write python

Publicado el: 12 julio 2018
en el canal de: Sandy
79
0

First, they are called f-strings because you need to prefix a string with the letter “f” in order to get an f-string, similar to how you create a raw string by prefixing it with “r”, or you can use the prefixes “b” and “u” to designate byte strings and unicode strings. Note that the “u” prefix was only necessary in Python 2 (“Legacy Python”), since native strings are the default now in Python 3.

The letter “f” also indicates that these strings are used for formatting. Now Python already provides several ways for formatting strings, so you may wonder why the Python gods introduced yet another way, in blatant violation of the Zen of Python, according to which there should be only one obvious way of doing things. In fact some people already complained about this. However, these people overlook that the Zen of Python also states that simple is better than complex and practicality beats purity - and yes, f-strings are really the most simple and practical way for formatting strings.


En esta página del sitio puede ver el video en línea F Strings : Inuitive way to write python de Duración hora minuto segunda en buena calidad , que subió el usuario Sandy 12 julio 2018, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 79 veces y le gustó 0 a los espectadores. Disfruta viendo!