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 air is 20% what?
What is a general rubric? A. a tool that helps publish an essay to a website B. a tool that has broad criteria that can apply to a variety of assignments C.
When liquid gold becomes a solid its particles get closer together which best describes what happened to the gold
Explain why it is important to meet standards recognized by leading agencies in the infection control field.
With a scale factor 1 : 25000 , what would be the real distance on a 6.8cm map?
The coordinates 40 degrees north and 100 degrees east falls in what country?
The mla format requires that you use wich of the following methods of in-text citation?
Which of the following does Not limit range of motion
Ken went to the store for his mother. He spent $2.37 on groceries. In addition, his mother said he could spend $0.35 on candy. What was his change from a five d
Isaac drinks 8 glasses of water each day. He says he will drink 2,920 glasses of water in a year that has 364 days. Is the exact answer reasonable?