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

ILL GIVE 10 PIONTS IF YOU ANSWER IM DESPERATE PLZPLZPLZPLZPLZ HELP ME ASAPWhich factor has the least impact on the potential energy or kinetic energy of an obj
oliver had saved $72.35 in his bank account, but decided to splurge on a very expensive present for his mom on mothers day. after he brought her present, his ba
Evaluate j/k -0.2k when j=25 and k=5
Find the inequality represented by the graph.
Express the following 48-bit binary MAC address in hexadecimal 11101100 – 00100111 – 10111001 – 11010101 – 01101111 – 10100011
Help again ((I suck at math
Suppose 34 % of students chose to study German their junior year, and that meant their junior year? lents. How many students chose not to take German
f divided by -2/3 = -1/3
You are driving in the right lane of an expressway and are approaching a ramp where traffic is entering the expressway. You should
What is the value of 4x - 7 when x=4? 1 9 16 23