This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def primeira_parte(quantity, last_index): | |
lista = quantity[:last_index] | |
# print(lista) | |
return sum(lista) | |
def segunda_parte(quantity, first_index): | |
lista = quantity[first_index:] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myLast :: Eq a => [a] -> a | |
myLast (x:xs) | |
| xs == [] = x | |
| otherwise = myLast xs | |
myLast' :: Eq a => [a] -> a | |
myLast' (x:y:xs) | |
| xs == [] = x | |
| otherwise = myLast' (y:xs) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'.source.python': | |
'model': | |
'prefix': 'sam' | |
'body': """ | |
class ${1:MODELNAME}(db.Model): | |
__tablename__ = "${2:TABLENAME}" | |
${3:FIELDNAMES} | |
def __init__(self): | |
${4:# TODO add initializer fields} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Prelude hiding (elem, map) | |
elem :: Eq a => a -> [a] -> Bool | |
elem _ [] = False | |
elem x (y:ys) | |
| x == y = True | |
| otherwise = elem x ys | |
factorial :: Int -> Int | |
factorial 1 = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Prelude hiding (elem, map) | |
elem :: Eq a => a -> [a] -> Bool | |
elem _ [] = False | |
elem x (y:ys) | |
| x == y = True | |
| otherwise = elem x ys | |
factorial :: Int -> Int | |
factorial 1 = 1 |