Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Mutable or Immutable? | Conhecendo os números em Python
Tipos de Dados em Python
course content

Conteúdo do Curso

Tipos de Dados em Python

Tipos de Dados em Python

1. Conhecendo os números em Python
2. Verdadeiro ou falso?
3. Strings
4. Reunindo todos os tópicos

book
Mutable or Immutable?

Understanding the difference between mutable and immutable data types is crucial. Mutable data types can be changed after their creation, while immutable data types cannot be modified once created.

Immutable data types cannot be changed once they're created. In contrast, mutable data types can be altered after their creation.

To conclude, int and float are examples of immutable data types in Python. Reassigning a variable of these types does not alter their immutability.

1234567
# Define a variable `var1` with an initial value var1 = 40 print(var1) # output: 40 # Change the value of `var1` var1 = 50 print(var1) # output: 50
copy
Tarefa

Swipe to start coding

Imagine you are managing a budget for a small project. Initially, your available budget is set to $100. However, you receive an additional funding of $50. Update the value of the project_budget variable to reflect the total available budget.

Once you've completed this task, click the button below the code to check your solution.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 2
toggle bottom row

book
Mutable or Immutable?

Understanding the difference between mutable and immutable data types is crucial. Mutable data types can be changed after their creation, while immutable data types cannot be modified once created.

Immutable data types cannot be changed once they're created. In contrast, mutable data types can be altered after their creation.

To conclude, int and float are examples of immutable data types in Python. Reassigning a variable of these types does not alter their immutability.

1234567
# Define a variable `var1` with an initial value var1 = 40 print(var1) # output: 40 # Change the value of `var1` var1 = 50 print(var1) # output: 50
copy
Tarefa

Swipe to start coding

Imagine you are managing a budget for a small project. Initially, your available budget is set to $100. However, you receive an additional funding of $50. Update the value of the project_budget variable to reflect the total available budget.

Once you've completed this task, click the button below the code to check your solution.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 2
Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
We're sorry to hear that something went wrong. What happened?
some-alt