Post

@PythonPr C.
P = '4' # is a string because of the quotes
q = 14 # Integer
r = p + str(q) # adds p to q and converts q into a string, result 414
s = int(r) / 2 # turns the result of r to an integer 414 and divides it by 2
Print(s) # 207.0. in python 3 division always returns a float.
English

@PythonPr Answer: (c) 207.0 The code executes as follows: p is initialized as a string '4'.q is initialized as an integer 14.r = p + str(q) concatenates the string '4' and the string representation of 14 ('14'), resulting in r being the string '414'.s
English

@PythonPr Just gonna say, the result is 207.0 because the / division gives a float. It’d be 207 if // was used instead.👍
English

@PythonPr Code or it didn't happen. Python puzzles always teach interpreter quirks.
English

@PythonPr And = C
p = '4' = string
q = 14 = integer
r = p+str(q) = '4' + '14' = '414' ( q is converted to a string and added to p)
s = int(r)/2 = 414/2 =207.0 ( r is converted back to an integer and then divided by 2)
English

@PythonPr I'm a beginner, so from what I've learned the answer should be "d" because variables and strings don't usually work togather
English





























