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 a hedge in science​
I want to know x=,y=,z=
Please help identify the interval. Brainliest to CORRECT answer. tyy
I got this moldavite online from India, I’m just wondering if it’s legit and also wondering...is there something I’m suppose to do before wearing it?
Pls help How do organisms adapt/survive decomposition?
What did the frontier mean to the nation in the first half of the nineteenth century?| pls help :)
root of 2x plus 1/3 square
Krystal made 8 quarts of soup on Monday 5 quarts of soup on Tuesday and 5 quarts of soup on Wednesday. If she serves each guest 1 cup of soup how many guests ca
think about the health goal to work on this semester. Explain your goal and what could potentially happen to your health if you are not able to reach the goal.
To make the chocolate shake, Dona added 40 mL of chocolate syrup, 200 mL of milk, and 400 mL of water. How much milk, in liters, would be required if she uses 4