Vote count: 0
Im trying to realize why some code fragments are invalid for my functions which can be called in various ways. To me all of them are valid according to their headers, type contracts and precondition. Do you see some invalid code fragment in here?. Any help will be welcome Thanks in advance
Code fragments:
burble(len(burble(1, 2.2)), 3.3)
burble([snorgle(1, 1.0), 'b'])
burble(snorgle(['a', 'b', 'c']), 8 // 3)
snorgle([burble(1, 1.0), 'b'])
This are the headers and type contracts:
def burble(a, b):
'''(int, float) -> str'''
def snorgle(L):
'''(list of str) -> float
Precondition: L has at least one element.'''
asked 8 secs ago
Why some code fragments are invalid for these headers?
Aucun commentaire:
Enregistrer un commentaire