Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Math in Strings | Reuniendo Todos los Temas
Tipos de Datos en Python
course content

Contenido del Curso

Tipos de Datos en Python

Tipos de Datos en Python

1. Familiarizándonos con los Números en Python
2. ¿Verdadero o Falso?
3. Strings
4. Reuniendo Todos los Temas

book
Math in Strings

It's time to let you dive deeper into programming! 😎

You've examined that the + operator can be applied to statements that are related to one data type: concatenate strings, add some numbers, etc. But please look at this simple example where input and output are pretty understandable for you: 😊

1
print(12 * 4)
copy

However, multiplication works not only with equal data types, but with various ones too. This means that we can multiply your string by a number. For instance, if we multiply it by 2, the string will be printed twice. Take a look at the following example:

1
print('12' * 4)
copy

Note

We can multiply a string only by an integer number.

Tarea
test

Swipe to begin your solution

Time to practice!

Follow the steps below and assign each result to the corresponding variable:

  1. Repeat the string1 twice and assign the result to statement1
  2. Repeat the string2 three times and assign the result to statement2

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 4. Capítulo 6
toggle bottom row

book
Math in Strings

It's time to let you dive deeper into programming! 😎

You've examined that the + operator can be applied to statements that are related to one data type: concatenate strings, add some numbers, etc. But please look at this simple example where input and output are pretty understandable for you: 😊

1
print(12 * 4)
copy

However, multiplication works not only with equal data types, but with various ones too. This means that we can multiply your string by a number. For instance, if we multiply it by 2, the string will be printed twice. Take a look at the following example:

1
print('12' * 4)
copy

Note

We can multiply a string only by an integer number.

Tarea
test

Swipe to begin your solution

Time to practice!

Follow the steps below and assign each result to the corresponding variable:

  1. Repeat the string1 twice and assign the result to statement1
  2. Repeat the string2 three times and assign the result to statement2

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 4. Capítulo 6
Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
We're sorry to hear that something went wrong. What happened?
some-alt