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

Find the value of z please help
A bag contains 3 blue marbles and 2 green marbles. What is the probability of drawing a blue marble followed by a green marble, without replacing the first marb
the 5th out of 10 questions
Understanding an author's culture helps a reader: A understand the meaning of a character's Behavior. B detailed ethical and unfamiliar words in the text. C int
what information is found in the dietary guidelines for Americans?
Find the volume (in terms of pi) of a sphere of its surface area is 400 pi ft2
PLEASE HELP WILL GIVE BRAINLIEST. GEOMETRY REFLECTIONS. INCLUDE EXPLANATION. BOGUS ANSWERS WILL BE REPORTED
Geometry math question no Guessing and Please show work thank you
1) People know that taking tests is hard, but you will get better grades by studying. 2) I learned this lesson when my friend and me studied all afternoon, then
According to the general equation for conditional probability, if P(AD) =4/7 and P(B)= 7/8, what is P(A B)? A.40/49 B. 16/49 C. 32/49 D. 24/49