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

Who were the scottsboro boys? how did they get into so much trouble?
Which situation would result with older sediments overlying younger sedimentary rocks?
Farmers from BLANK revolted against its unresponsive government.
An artist follows this formula for making a special tricolored bracelet: 8 orange beads + 3 red beads + 4 green beads + 1 string → 1 bracelet how many special t
This landform which makes up much of western europe was formed by sheets of ice during the ice age:
please help. me pleaseeeeee
The product of the page numbers on two facing pages of a book is 272272. find the page numbers.
How many different 9-letter words (real or imaginary) can be formed from the letters in the word assistant?
Simplify the expression (first picture) A. (second Picture) B. (third Picture) C. (fourth picture) D. (fifth picture)
You have gathered this information on jj enterprises: what is the operating cash flow for 2015?