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

Thomas drew a rectangle with a area of 6 square centimeters what is the greatest possible perimeter
The force of gravity down on the boy= 300N The boy's weight down on the floor= 300N The floor's reaction force back up on the boy= 300N His WEIGHT IS EVENLY DIS
what fraction is between 0 and 1/2
Annabelle picked 65 apples at a local orchard.40% of the apples were green apples.how many green apples did annabelle pick?
Why is external criticism so important when it comes to analyzing data?
Why does friction make it harder to move things?
Bryson buys a bag of 64 plastic miniature dinosaurs . could he distribute them equally into six storage containers and not have any left over?explain .
a number equivalent to 63.24
where the sun's energy is produced
Carina will drive 4.5 hours at an average speed of 55 miles per hour to reach her parents' house. How many miles will she drive?