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

Does an owl have a backbone?
The ______ was established in 1943 to assist in the transition from a peacetime to a wartime economy ?
The ______ was established in 1943 to assist in the transition from a peacetime to a wartime economy ?
What is the creepiest sounding scale? What scale would u use for writing creepy music in other words
What is the creepiest sounding scale? What scale would u use for writing creepy music in other words
Does an owl have a backbone?
Forget the motor When im on the boat Think of the best time To buy a new coat What am I......?
A blue rope is 3 times the length as a red rope. A green rope is 5 times as log as the blue rope of the total length of all 3 ropes equals 508.25m what is the l
Thelma spent 1/6 of her weekly allowance on dog toys.  1/4 on a dog collar and 1/3 on dog food.  What fraction of her weekly allowance is left
What's 5 divided by x squared explain