Условие, условие:
- Правим нещо
- После друго нещо
- Накрая трето
from subprocess import check_output | |
from shlex import split | |
import json | |
REGIONS = ( | |
'us-east-2', | |
'us-east-1', | |
'us-west-1', | |
'us-west-2', |
def schema_validator(schema: Schema, data: Data) -> Tuple[bool, MissingKeys, AdditionalKeys]: | |
schema_paths = set(build_paths(get_paths(schema))) | |
data_paths = set(build_paths(get_paths(data))) | |
missing_keys = schema_paths - data_paths | |
additional_keys = data_paths - schema_paths | |
return schema_paths == data_paths, sorted(missing_keys), sorted(additional_keys) |
#lang racket | |
(define (decreasing? ns) | |
(cond | |
[(empty? ns) #f] | |
[(empty? (rest ns)) #t] | |
[else (and (>= (first ns) (second ns)) (decreasing? (rest ns)))])) | |
(define (number->list n) | |
(define (iter n result) |
def count_elements(xs): | |
count = 0 | |
for element in xs: | |
count += 1 | |
return count | |
n = input("Enter n: ") |
def divisors(n): | |
result = [] | |
start = 1 | |
while start < n: | |
if n % start == 0: | |
result = result + [start] | |
start += 1 |
names = ["Ivan", "Asen", "Vtori"] | |
result = "" | |
index = 0 | |
last = len(names) - 1 | |
for name in names: | |
if index == last: | |
result = result + name | |
else: |
module A (omgwtf) where | |
omgwtf :: Int -> Int | |
omgwtf x = x + 1 |
/* global module, console */ | |
module.exports = function(http, port) { | |
'use strict'; | |
var routes = {}; | |
var exportMethods = {}; | |
var middlewares = []; | |
['get', 'post', 'put', 'delete'].forEach(function(method) { | |
routes[method] = routes[method] || {}; |
; в този вариант, функцията compose връща директно резултата | |
; като изпълниш (f (g x)) - ако x е число, накрая просто ще ти върне някакъв резултат | |
(define (compose-first f g x) | |
(g (f x))) | |
; например това извикване ще ти даде директно резултат 2 | |
(compose-first (lambda (x) (+ x 1)) (lambda (x) (- x 1)) 2) | |
; този compose, не ти връща директно скаларен резултат |