Har testat att skriva samtidigt på papper men jag har svårt att få ner vad jag vill ha gjort eftersom jag inte vet i vilken ände jag ska börja. Här är min senaste uppgift som jag inte löste:
"Implement the function kcals for computing the amount of kilocalories in a receipe. The first argument of the function should be a dictionary which maps a product name to the number of kilocalories per unit. The second argument should be a list of tuples. The first element of each tuple is the quantity and the second element is the name of the product.
For example kcals({'ägg': 137}, [(2,'ägg')]) should return 137*2=274 kilocalories for a receipe which includes only two eggs."
Vad är det du har svårt med i det här exemplet? Förstår du den övergripande uppgiften? Har du problem med tekniska termer som dictionary, map och tuple? Eller är det implementationsdetaljerna du är osäker på? Dvs du förstår uppgiften precis, men inte hur du ska lösa den. Eller något annat?
Det är helt klart vanligt att man blir överväldigad, men utan att veta vad ni har fått lära er hittills är det svårt att säga huruvida uppgiften är rimlig.