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

The joining of nuclei and chromosomes is known as
What can homeless people see,hear,feel,smell,taste
how did the Silk Road influence Chinese culture
what was the significance of Columbus's voyages
what is air currents caused by temperature differences
How are plasmids used in biotechnology? A. For respiration in prokaryotes B. For photosynthesis in eukaryotes C. For protein synthesis in prokaryotes and eukary
2 differences between the people in Shakespeare's time period and the people today?
why does the body need so many organ systems
What made the Mexican victory so remarkable and suprising? A. The French were larger and better equipped. B. The Mexican army had no weapons. C. The French paid
There are 20 guests at a party the host has 8 gallons of punch he estimates that each guest will drink 2 cups of punch if his estimate is correct how much punch