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

James has 3 hats, 2 pairs of shorts, and 5 shirts to chose from. If he wears exactly 1 of each item, how many different combinations (1 hat, 1 shirt, and 1 pair
Voy a comprar un nuevo piso ______________ venda el viejo. A. pero B. en cuanto C. sin D. además
I just need the formula
At the state fair, admission at the gate is $8 . In addition, the cost of each ride is $3 . Suppose that Joe will go on x rides. Joe wants the total number of d
It is appropriate for clients diagnosed with type 2 diabetes to take oral antidiabetic agents and forego recommended dietary changes.​
Geometry math question
A function, named g, has an input of c, and a range of all real numbers. What’s the function?
suppose the correlation coeffecient
please help to me solve these ! :)
Geometry math question