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 is the prefix of active
what is the additive inverse opposite of 18/23
find the slope of the line that contains (1,6) and (10, -9).
what is the additive inverse opposite of 18/23
Juan Ramirez sells suits in a major department store on weekends. he earns a commission of 5 percent on the first ten suits, and if he sells more than ten, he e
All real number zeros of the polynomial 2x^4 + 4x^2 + 6x^9 - x + 3x^9 - 5x^9 + 2x^8
Which expressions, when evaluated with x = –9, are negative in value? Choose all answers that are correct. A. –2x – 8 B. –26 – 2x C. 35 + 3x D. –3x
two sisters, jenny and penny, play on the same basketball team. last season they scored a combined total of 458 points. jenny scored 192 of the points. write an
are there forests in Hungary
what act did the united states government pass in order to be able to move Native American of their lands into the Indian's Territory? A) Native American Act B)