Python

String Formatting with Arithmetic Operations in Python

AKA.DM 2024. 10. 11. 07:52
반응형

We have learned in our previous lessons that we can perform arithmetic operations on string values.

However, we should not have thought of these arithmetic operations mathematically.

For example, aggregation was used to concatenate string values.

 

You can also do this collection as follows:

You can perform your operations from a shortcut by using the arithmetic operator before "equals".

 

You can perform the multipication operation in strings by using the mutiplication operator.

Again, as a shortcut, you can reach your goal by saying "arithmetic operator, equals" as below.

반응형