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

2/3 of 2 how do i get this answer
Handwritten solution required
If Ally passed her licensing exam on Jan 15,2019 when should she complete her 30 hr Post Licensing course per Indiana guidelines?
I have a question asking "What is the average value of the function x^2+4x-9 on the interval [-1,7]?" I keep on getting the answer 10 by plugging in -1 for x an
6. Describe the functions of the Infrastructure Tracking Unit, the Processing Unit, and the Visual Unit with clear flow charts? 7. List down and explain common
In the adjoining figure, prove A + B + C + D + E = 180° ​
The scale ratio on Emily’s map of jogging is 1:50 000. She chooses a route approximately 12cm long on the map. How far is she planning to jog?
Which of the following is the FIELD in a database table? Account_Balance $2,109.49 $1,345.20 $969.78
Handwritten solution required
Handwritten solution required