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

why or why not should us citizens be allowed to vote by mail​
What is the main problem or conflict in this story? A. Sydney does not want to go to her new school. B. Beth and Sydney cannot find their classroom. C. Beth
Which function is best represented by this graph? Brainliest
Show that among all rectangles with area a the square has the minimum perimeter
what is happening in the mechanical engineering field right now
Which transformations are needed to change the parent cosine function to y = 0.35 cosine (8 (x minus startfraction pi over 4 endfraction))? vertical stretch of
Henry Moore's work was different because... It was best experienced by interaction, people could climb on/in it It was non-objective he believed in having an ac
if raymond had 50 dogs and gets 80 how many does he have?
please help me. its my homework due at 11:59. realy need help well get a A+
what is the measure of the space occupied by a solid. (Measured in cubic units)