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

A struggle or clash that drives the plot is known as __________. A. theme B. point of view C. conflict D. characterization
State programs such as education, transportation, and public safety are implemented by which branch of government? A.judicial B.legislative C.executive D.federa
how much is a kilogram???
Let f(x) = x - 2 and g(x) = x2 - 7x - 9. Find f(g(-1)).
Why did reform movements grow out of the Realist movement?
-7(1+7n)=36-6n this is a very hard solving equations question I don't get HELP!!!
carbohydrates provide the body with
HELP!!!!!! Which verb form agrees with the subject and correctly completes the sentence? Peanut plants __________ thousands of acres in the American South. A.
In what respects was Japan's 19th century transformation revolutionary?
Which of the following words best describes Africa? A. Country B. Continent C. Desert D. River