#mangrouppyquiz search results

Almost half way! How have you been scoring? Q5: What happens if you run this py3 code? #ManGroupPyQuiz #pythonquiz #pythonprogramming

ManQuantTech's tweet image. Almost half way! How have you been scoring?

Q5: What happens if you run this py3 code?

#ManGroupPyQuiz #pythonquiz #pythonprogramming

(1/3) Q6 Ans: [10,10,10,10,10] The L1 fns are closures: they have access to a variable from the enclosing scope that has completed its execution (the list comprehension). Py closures are late binding: their value is looked up at the time the closure is called #ManGroupPyQuiz

ManQuantTech's tweet image. (1/3) 
Q6 Ans: [10,10,10,10,10]
The L1 fns are closures: they have access to a variable from the enclosing scope that has completed its execution (the list comprehension). Py closures are late binding: their value is looked up at the time the closure is called

#ManGroupPyQuiz

Just two left, but you may have noticed that they're progressively getting harder - so good luck! Q9: What happens if you run this py3 code? #ManGroupPyQuiz #pythonquiz #pythonprogramming

ManQuantTech's tweet image. Just two left, but you may have noticed that they're progressively getting harder - so good luck!

Q9: What happens if you run this py3 code?

#ManGroupPyQuiz #pythonquiz #pythonprogramming

Final question – has anyone got every question correct so far?! (This one is particularly fiendish!) Q10: What happens if you run this py3 code? #ManGroupPyQuiz #pythonquiz #pythonquestion

ManQuantTech's tweet image. Final question – has anyone got every question correct so far?! (This one is particularly fiendish!)

Q10: What happens if you run this py3 code?

#ManGroupPyQuiz #pythonquiz #pythonquestion

(2/2) Python quirk alert: 🐍 keeps an array of ints between -5 & 256 When you create an int in that range you get a reference to a pre-existing object After L8&9, a& b reference the same object again! 🤯 You heard it here first (we assume) #ManGroupPyQuiz #pythonquirkalert


That’s a wrap! Hope you enjoyed the #ManGroupPyQuiz Which question do you think was the hardest? #pythonquiz #pythonprogramming #pythonquirkalert #learntocode


(2/3) By the time the lambda fns are called the list comprehension has executed and i==4 so all the lamba fns return 10. Fix the code in question 6 by writing: multipliers = [lambda x, i=i: (i+1)*x for i in range(5)] #ManGroupPyQuiz #pythonquiz #learntocode


(3/3) This forces the early binding of “i” as a default argument in the lambda fns. This works due to the behaviour we saw in Q4 - default args are created once, at the time the fn is created, rather than when it is called #ManGroupPyQuiz #pythonquiz #pythonprogramming


Q4 Ans: [1,2,3,4,5,6] The default arg, “my_list”, is mutable, so it isn't instantiated with every function call Calling the fn twice adds the other args to the same list instance each time Don't use mutable types as default args! #ManGroupPyQuiz #pythongotcha


Q5 Ans: “Still waiting…” Python does not have a decrement operator so line 4 has no effect. It just gets parsed as two negative signs in a row, i.e. the equivalent of “-(-seconds)” #ManGroupPyQuiz #learncoding #pythonprogramming

Almost half way! How have you been scoring? Q5: What happens if you run this py3 code? #ManGroupPyQuiz #pythonquiz #pythonprogramming

ManQuantTech's tweet image. Almost half way! How have you been scoring?

Q5: What happens if you run this py3 code?

#ManGroupPyQuiz #pythonquiz #pythonprogramming


(1/2) Q10 Ans: True False True “a” & “b” start off referencing the same int object. After L4 & L5 they both reference different int objects with the same value, so no longer have reference equality #ManGroupPyQuiz #pythonquirkalert

Final question – has anyone got every question correct so far?! (This one is particularly fiendish!) Q10: What happens if you run this py3 code? #ManGroupPyQuiz #pythonquiz #pythonquestion

ManQuantTech's tweet image. Final question – has anyone got every question correct so far?! (This one is particularly fiendish!)

Q10: What happens if you run this py3 code?

#ManGroupPyQuiz #pythonquiz #pythonquestion


Q9 Ans: Error Tuples do not support item assignment so, while you can add an item to the list at position 0 you cannot then assign that list to be item 0 in the tuple #ManGroupPyQuiz #pythonquiz #pythonprogramming #tuples

Just two left, but you may have noticed that they're progressively getting harder - so good luck! Q9: What happens if you run this py3 code? #ManGroupPyQuiz #pythonquiz #pythonprogramming

ManQuantTech's tweet image. Just two left, but you may have noticed that they're progressively getting harder - so good luck!

Q9: What happens if you run this py3 code?

#ManGroupPyQuiz #pythonquiz #pythonprogramming


Q8 Ans: 12 1 123 1 The += operator only uses the __iadd__ method if it exists. Strings are immutable so do not have __iadd__ therefore lines 3 and 7 are equivalent #ManGroupPyQuiz #pythonquiz #pythongotcha


Our python quiz is now written up for easy reading on @efc_global ! All the @ManQuantTech developers tried their hand at these questions at our virtual offsite last month - Good luck! #ManGroupPyQuiz bit.ly/2Ukx4pC #pythongotchas #pythonquirkalert #pythonprogramming


Our python quiz is now written up for easy reading on @efc_global ! All the @ManQuantTech developers tried their hand at these questions at our virtual offsite last month - Good luck! #ManGroupPyQuiz bit.ly/2Ukx4pC #pythongotchas #pythonquirkalert #pythonprogramming


That’s a wrap! Hope you enjoyed the #ManGroupPyQuiz Which question do you think was the hardest? #pythonquiz #pythonprogramming #pythonquirkalert #learntocode


(2/2) Python quirk alert: 🐍 keeps an array of ints between -5 & 256 When you create an int in that range you get a reference to a pre-existing object After L8&9, a& b reference the same object again! 🤯 You heard it here first (we assume) #ManGroupPyQuiz #pythonquirkalert


(1/2) Q10 Ans: True False True “a” & “b” start off referencing the same int object. After L4 & L5 they both reference different int objects with the same value, so no longer have reference equality #ManGroupPyQuiz #pythonquirkalert

Final question – has anyone got every question correct so far?! (This one is particularly fiendish!) Q10: What happens if you run this py3 code? #ManGroupPyQuiz #pythonquiz #pythonquestion

ManQuantTech's tweet image. Final question – has anyone got every question correct so far?! (This one is particularly fiendish!)

Q10: What happens if you run this py3 code?

#ManGroupPyQuiz #pythonquiz #pythonquestion


Final question – has anyone got every question correct so far?! (This one is particularly fiendish!) Q10: What happens if you run this py3 code? #ManGroupPyQuiz #pythonquiz #pythonquestion

ManQuantTech's tweet image. Final question – has anyone got every question correct so far?! (This one is particularly fiendish!)

Q10: What happens if you run this py3 code?

#ManGroupPyQuiz #pythonquiz #pythonquestion

Q9 Ans: Error Tuples do not support item assignment so, while you can add an item to the list at position 0 you cannot then assign that list to be item 0 in the tuple #ManGroupPyQuiz #pythonquiz #pythonprogramming #tuples

Just two left, but you may have noticed that they're progressively getting harder - so good luck! Q9: What happens if you run this py3 code? #ManGroupPyQuiz #pythonquiz #pythonprogramming

ManQuantTech's tweet image. Just two left, but you may have noticed that they're progressively getting harder - so good luck!

Q9: What happens if you run this py3 code?

#ManGroupPyQuiz #pythonquiz #pythonprogramming


Just two left, but you may have noticed that they're progressively getting harder - so good luck! Q9: What happens if you run this py3 code? #ManGroupPyQuiz #pythonquiz #pythonprogramming

ManQuantTech's tweet image. Just two left, but you may have noticed that they're progressively getting harder - so good luck!

Q9: What happens if you run this py3 code?

#ManGroupPyQuiz #pythonquiz #pythonprogramming

Q8 Ans: 12 1 123 1 The += operator only uses the __iadd__ method if it exists. Strings are immutable so do not have __iadd__ therefore lines 3 and 7 are equivalent #ManGroupPyQuiz #pythonquiz #pythongotcha


(3/3) This forces the early binding of “i” as a default argument in the lambda fns. This works due to the behaviour we saw in Q4 - default args are created once, at the time the fn is created, rather than when it is called #ManGroupPyQuiz #pythonquiz #pythonprogramming


(2/3) By the time the lambda fns are called the list comprehension has executed and i==4 so all the lamba fns return 10. Fix the code in question 6 by writing: multipliers = [lambda x, i=i: (i+1)*x for i in range(5)] #ManGroupPyQuiz #pythonquiz #learntocode


(1/3) Q6 Ans: [10,10,10,10,10] The L1 fns are closures: they have access to a variable from the enclosing scope that has completed its execution (the list comprehension). Py closures are late binding: their value is looked up at the time the closure is called #ManGroupPyQuiz

ManQuantTech's tweet image. (1/3) 
Q6 Ans: [10,10,10,10,10]
The L1 fns are closures: they have access to a variable from the enclosing scope that has completed its execution (the list comprehension). Py closures are late binding: their value is looked up at the time the closure is called

#ManGroupPyQuiz

Q5 Ans: “Still waiting…” Python does not have a decrement operator so line 4 has no effect. It just gets parsed as two negative signs in a row, i.e. the equivalent of “-(-seconds)” #ManGroupPyQuiz #learncoding #pythonprogramming

Almost half way! How have you been scoring? Q5: What happens if you run this py3 code? #ManGroupPyQuiz #pythonquiz #pythonprogramming

ManQuantTech's tweet image. Almost half way! How have you been scoring?

Q5: What happens if you run this py3 code?

#ManGroupPyQuiz #pythonquiz #pythonprogramming


Almost half way! How have you been scoring? Q5: What happens if you run this py3 code? #ManGroupPyQuiz #pythonquiz #pythonprogramming

ManQuantTech's tweet image. Almost half way! How have you been scoring?

Q5: What happens if you run this py3 code?

#ManGroupPyQuiz #pythonquiz #pythonprogramming

Q4 Ans: [1,2,3,4,5,6] The default arg, “my_list”, is mutable, so it isn't instantiated with every function call Calling the fn twice adds the other args to the same list instance each time Don't use mutable types as default args! #ManGroupPyQuiz #pythongotcha


Q3 Ans: 2 - 75% got this one correct 👏 “bool” is a subtype of “int” (for quirky historical reasons - bit.ly/2Xy1ipI) so summing the list of bools is equivalent to summing a list of ints #ManGroupPyQuiz #pythonquiz #pythonprogramming


No results for "#mangrouppyquiz"

First question of our python quiz! What happens if you run this py3 code? #ManGroupPyQuiz #pythonquiz #pythonprogramming #tuples

ManQuantTech's tweet image. First question of our python quiz! 

What happens if you run this py3 code? #ManGroupPyQuiz 

#pythonquiz #pythonprogramming #tuples

Almost half way! How have you been scoring? Q5: What happens if you run this py3 code? #ManGroupPyQuiz #pythonquiz #pythonprogramming

ManQuantTech's tweet image. Almost half way! How have you been scoring?

Q5: What happens if you run this py3 code?

#ManGroupPyQuiz #pythonquiz #pythonprogramming

Just two left, but you may have noticed that they're progressively getting harder - so good luck! Q9: What happens if you run this py3 code? #ManGroupPyQuiz #pythonquiz #pythonprogramming

ManQuantTech's tweet image. Just two left, but you may have noticed that they're progressively getting harder - so good luck!

Q9: What happens if you run this py3 code?

#ManGroupPyQuiz #pythonquiz #pythonprogramming

Final question – has anyone got every question correct so far?! (This one is particularly fiendish!) Q10: What happens if you run this py3 code? #ManGroupPyQuiz #pythonquiz #pythonquestion

ManQuantTech's tweet image. Final question – has anyone got every question correct so far?! (This one is particularly fiendish!)

Q10: What happens if you run this py3 code?

#ManGroupPyQuiz #pythonquiz #pythonquestion

(1/3) Q6 Ans: [10,10,10,10,10] The L1 fns are closures: they have access to a variable from the enclosing scope that has completed its execution (the list comprehension). Py closures are late binding: their value is looked up at the time the closure is called #ManGroupPyQuiz

ManQuantTech's tweet image. (1/3) 
Q6 Ans: [10,10,10,10,10]
The L1 fns are closures: they have access to a variable from the enclosing scope that has completed its execution (the list comprehension). Py closures are late binding: their value is looked up at the time the closure is called

#ManGroupPyQuiz

Loading...

Something went wrong.


Something went wrong.


United States Trends