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

Which of the following linear equations matches the graph? y = 1/x y = 1/3 x y = 3x y = -x y = x
Find the domain of the following expressions:
How many grams of chlorine gas are needed to make 117 grams of sodium chloride? Given the reaction: 2Na + Cl2 → 2NaCl
leukopenia is a disease in which the body has less than normal number of white blood cells what effect would leukopenia have on health of a person
Im getting hit offline can someone help or give me some advice
Marquise is 9 years old. In two years, Marquise will be 1/3 of his mother’s age. What is his mother’s age?
Find the equation of a line (5,-2) (-3, -2)
Need help answering this question tysm! (Picture attached)
What is the answer plz ?
is a leuplast the same thing as a cloroplast because the question is This organelle is found in plant cells. The function of this organelle is to collect solar