autumnnicole36582
autumnnicole36582 autumnnicole36582
  • 03-03-2021
  • Computers and Technology
contestada

Do you think we could use mathematical operators on string values rather than integers or floats? Explain.

Respuesta :

60002135330 60002135330
  • 03-03-2021

Answer:

Yes and no. For example, you can do this:

print('hi' * 5)

Output:

hihihihihi

HOWEVER, you cannot do mathematical operations on strings. If I have a string "6" and try dividing it by 3, it's not going to work because... it's not an integer. While multiplying strings does work, you cannot actually do real math with strings unless you change them to int or float

Answer Link

Otras preguntas

What does Lori B. Wicks like best about working as an artist? (Site 1)
Odd numbers greater than -40 but less than -28
How did the Inuit adapt to there climate select all that apply
There are (3^5)^2 ⋅ 30 leaves on a tree. What is the total number of leaves on the tree?
The southeast ceremonial complex refers to the loose networks that connected the societies of the
A cell moves particles from a region of lesser concentration to a region of higher concentration by
Danielle has an excessive, unrealistic fear of shopping in crowded stores and walking through crowded streets. she has ________.
Algebraic expression of 25 less than a number d
Excellent water supply can reduce the morbidity from typhoid fever by what percentage (potentially)?
T/F A company that uses tight cost controls is likely to use a low-cost leadership strategy.