I'm learning c++ and our Prof. wants us to understand whether the things we have learnt would/wouldn't function in other languages.
Would the following code in python print "I love my dog ..." (for every array instance) AND "my favourite dog is jack" or just the latter?
pets = ['flufffy', "jack", 'larry']
for a in pets:
print "I love my dog %s" % a
print "My favourite dog is %s" % pets[1]
in c++ if the a
was not declared the loop wouldn't compile/run properly if mi correct.