l = [1, 2, 3, 4, 5, 6, 7]
result = [i for i in l if i < 5]
print(result)
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
| <loading-container [loadable]="news$ | async"> | |
| <p *ngFor="let item of (news$ | async).entities">{{item}}</p> | |
| </loading-container> |
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
| /* | |
| '(', '{', '[' are called "openers". | |
| ')', '}', ']' are called "closers". | |
| Write an efficient function that tells us whether input string's openers | |
| and closers are properly nested. | |
| Examples: | |
| "{ [ ] ( ) }" -> true | |
| "{ [ ( ] ) }" -> false |
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 React, { Fragment } from 'react'; | |
| import PropTypes from 'prop-types'; | |
| import classnames from 'classnames'; | |
| import Link from '@tamm/ui-lib-link'; | |
| import Icon from '@tamm/ui-lib-icon'; | |
| import FeedbackModal from '@tamm/ui-lib-feedback-modal'; | |
| import nop from '@tamm/ui-lib-utils/nop'; | |
| import './Feedback.less'; | |
| import { STEP } from '@tamm/ui-lib-feedback-modal/FeedbackModal.const'; |
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
| describe("EventRecommender", () => { | |
| const EventRecommender = require('../app/EventRecommender'); | |
| let er; | |
| beforeEach(() => { | |
| er = new EventRecommender(); | |
| }); | |
| describe("addEvent", () => { | |
| it("adds a new Event to the system", () => { |
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
| /** | |
| * It takes commit message and append a branch name below | |
| */ | |
| const fs = require('fs'); | |
| const childProcess = require('child_process'); | |
| const commitMessageFile = process.argv[2]; | |
| /** |
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
| BEGIN TRANSACTION; | |
| CREATE TABLE IF NOT EXISTS "posts_tags" ( | |
| "post_id" INTEGER, | |
| "tag_id" INTEGER, | |
| FOREIGN KEY("post_id") REFERENCES "posts"("id"), | |
| FOREIGN KEY("tag_id") REFERENCES "tags"("id") | |
| ); | |
| CREATE TABLE IF NOT EXISTS "posts" ( | |
| "id" INTEGER NOT NULL, | |
| "title" VARCHAR(100), |
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
| describe("sum", function() { | |
| it("функция", function() { | |
| assert.isOk(typeof sum === "function"); | |
| }); | |
| it("по-умолчанию инициализируется нулем", function() { | |
| assert.isOk(+sum() === 0); | |
| }); | |
| it("инициализируется числом", function() { | |
| assert.isOk(+sum(5) === 5); | |
| }); |
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
| alert(1); |