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 was a result of the War of 1812? A. New Orleans was returned to French control after a victory by Napoleon's army. B. Americans voted President James Madi
what does at least and at most mean?
Is it possible to cut a rectangular prism so that its cross section is a circle orman ellipse?
What causes rocks to change composition when reacting with oxygen? Please help!!
Which ocean served as a highway for explorers, early settlers, and later immigrants to North America?
sample#1 contains thymine cytosine and guanine proteins sugars and lysosomes sample#2 contains adenine uracil cytosine and guanine amino acids and carbohydrates
Kara is 18 years younger than Joseph. Twelve years ago, Joseph was 4 times as old as Kara. Find their present ages.
what did stone age people wear?
Gentry poured 23.5 ounces of milk and 7.75 ounces of cream in a mixing bowl. How much more cream could Gentry add to the bowl if the capacity of the bowl is 35.
what is a color wheel plz help