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

Can you please help me??
Point A is located at ​(4, 8)​ and point B is located at ​(14, 10)​ . What point partitions the directed line segment ​ AB⎯⎯⎯⎯⎯ ​ into a 1:3 ratio? (612,
these may form where rock has been dissolved
who is the richest person in the world
Which classification best represents a triangle with side lengths 6cm,10cm and 12cm
Which is a better conductor, metal or non metal
The table shows the mass and boiling point of some substances. Boiling Point of Substances Mass (kg) Boiling Point of Water (°C) Boiling Point of Soybean Oil
What is the slope intercept form of 7x-y=35
Why were Europeans attracted to settle in Georgia? A.Because it was an established state. B.Because it was the largest state. C.Because of the other Anglo settl
Central Asia is boarded by ______ in the noth and ________ in the east. A. Russia. . . China B. The Caspian Sea. . . China C. The Caspian Sea. . . Russia D.