March 13, 2018 at 8:47 pm
Comments posted to this topic are about the item Python division
March 14, 2018 at 12:14 am
nice question, thanks Steve
a small error in the answer:
|
correct answer = -20, yet the explanation states 21?
____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
βlibera tute vulgaris exβ
March 14, 2018 at 1:14 am
If I read this this article the result should be -21.
Louis.
March 14, 2018 at 1:45 am
Tsk, tsk...
March 14, 2018 at 2:15 am
Louis Hillebrand - Wednesday, March 14, 2018 1:13 AMIf I read this this article the result should be -21.Louis.
+1
Tried an online Python compiler and it also returned -21, so I guess -21 is the correct answer.
March 14, 2018 at 2:21 am
"The // operator is an integer division operator" that's false (-20). It's a FLOOR division (-21).
Learn the Syntax
March 14, 2018 at 4:51 am
March 14, 2018 at 6:32 am
If the question had been "81 // 4" it would have been 20, but "-81 // 4" is -21...
Can we get this point back? Petty perhaps, but still...
March 14, 2018 at 7:19 am
roger.plowman - Wednesday, March 14, 2018 6:32 AMIf the question had been "81 // 4" it would have been 20, but "-81 // 4" is -21...Can we get this point back? Petty perhaps, but still...
You got more points by typing a response than the question is worth.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 β Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
March 14, 2018 at 7:23 am
All replies agreed that the correct answer should be -21 (because one of the operands is negative). In this case, can we get our point back for today's breakfast? π
March 14, 2018 at 8:55 am
MariusJarzebowski - Wednesday, March 14, 2018 7:23 AMAll replies agreed that the correct answer should be -21 (because one of the operands is negative). In this case, can we get our point back for today's breakfast? π
You did by posting. Honestly, points are rather....well...pointless. They are also super easy to earn. Just start answering forum questions.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 β Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
March 14, 2018 at 8:55 am
Carlo Romagnano - Wednesday, March 14, 2018 2:21 AM"The // operator is an integer division operator" that's false (-20). It's a FLOOR division (-21).
Learn the Syntax
That's what I found too (just a different post)
March 14, 2018 at 8:57 am
Sean Lange - Wednesday, March 14, 2018 8:55 AMMariusJarzebowski - Wednesday, March 14, 2018 7:23 AMAll replies agreed that the correct answer should be -21 (because one of the operands is negative). In this case, can we get our point back for today's breakfast? π
You did by posting. Honestly, points are rather....well...pointless. They are also super easy to earn. Just start answering forum questions.
So that's why I can never seem to find a place to "spend" them π
March 14, 2018 at 9:30 am
Verified online at python.org. Answer was -21.
March 14, 2018 at 3:26 pm
Hate to see the (red x) Incorrect for my answer when I know I got it right.
Viewing 15 posts - 1 through 15 (of 22 total)
You must be logged in to reply to this topic. Login to reply