Template literals are enclosed by the backtick (`) (grave accent) character instead of double or single quotes.
Untagged template literals result in strings, which makes them useful in string interpolation and multiline strings.
| def counting_valleys(n: int, s: str) -> int: | |
| valleys = 0 | |
| state = 0 | |
| is_sea_level = True | |
| for step in s: | |
| if step == 'D': | |
| state -= 1 | |
| else: | |
| state += 1 |
| ''' | |
| Dada uma palavra S, implemente uma função que devolve True se a palavra é um | |
| palíndromo e False se não for. Um palíndromo é uma palavra ou sequência de | |
| palavras que se escreve da mesma forma da direita para a esquerda e da | |
| esquerda para a direita. Os espaços contam como caracteres nesta versão. | |
| ''' | |
| def solution(S): | |
| for i in range(len(S) // 2): | |
| if S[i] != S[-1 - i]: |
| def solution(X, A): | |
| if X not in A: | |
| return -1 | |
| steps = set() | |
| target_len = len(set(range(1, max(A) + 1))) | |
| for idx, el in enumerate(A): | |
| steps.add(el) | |
| if target_len == len(steps): |
| def solution(arr): | |
| return sum(arr) |
| def solution(N): | |
| N = bin(N)[2:] | |
| maximum = count = 0 | |
| one_flag = False | |
| for num in N: | |
| if num == '1': | |
| if count > maximum: | |
| maximum = count | |
| count = 0 |
| " ---------------------------------------------------------------------- | |
| " | General Settings | | |
| " ---------------------------------------------------------------------- | |
| syntax on " Enable syntax highlighting | |
| set autoindent " Copy indent to the new line | |
| set backspace=indent " ┐ | |
| set backspace+=eol " │ Allow `backspace` |
The content was based in some of the most popular and solid MVC frameworks such as Ruby on Rails, CakePHP and Laravel.
create and edit.| from time import sleep | |
| from selenium import webdriver | |
| from argparse import ArgumentParser | |
| __author__ = "Kaio Duarte" | |
| __email__ = "duartedossantos@gmail.com" | |
| class Game(object): |
| import re | |
| from bs4 import BeautifulSoup | |
| from selenium import webdriver | |
| URL = "http://materializecss.com/color.html" | |
| HEX_RE = r"^#([A-Fa-f0-9]){3,6}$" | |
| class Crawler(object): | |
| def __init__(self, headless=True): |