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

Describe how the English-speaking population first came to Australia.
Why does paine think that association with britain hunts america trade
Which is 216 written as a power of a number? a. 6^3 b. 3^6 C. <------ 108^2 d. 72^3
10.4% of what number is 13
A reason why slavery developed in the American colonies was
Find the area of an equilateral triangle (regular 3-gon) with the given measurement in terms with a radical. 6-inch side. A = sq. in.
According to Islamic law, Muslims are forbidden to __________. a. eat meat b. drive a car c. drink alcohol d. join the military
what is mother teresa's marital status
how do i make 45/150 a fraction and a decimal
Most European nations have a dominant culture. a. True b. False