This file contains 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 pandas as pd | |
def periodo(linha): | |
horario = linha['hora completa'] | |
if '06:00:00' < horario < '11:59:00': return 'Manha' | |
elif '12:00:00' < horario < '17:59:00': return 'Tarde' | |
elif '18:00:00' < horario < '23:59:00': return 'Noite' | |
elif '00:00:00' < horario < '05:59:00': return 'Madrugada' | |
return '' |
This file contains 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 random | |
def gera_lista(qnt): | |
listas = [] | |
numeros = random.sample(range(1, 100), 25) | |
# Sorteia 13 elementos da lista `numeros` | |
primeiros = random.sample(numeros, 13) | |
# Pega a diferença entre a lista `numeros` e a lista `primeiros` | |
# e define como novo valor da lista `numeros` | |
numeros = list(set(numeros).difference(set(primeiros))) |
This file contains 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 random | |
from itertools import chain | |
numeros = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25] | |
listas = [] | |
def gera_lista(qnt): | |
nova_lista = [] | |
# Sorteia os 13 primeiros elementos | |
primeiros = random.sample(numeros, 13) |
This file contains 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
# Pergunta: https://pt.stackoverflow.com/questions/300478/ | |
n = int( input() ) | |
colecao = [ list( map(int, input().split(',')) ) for _ in range(n) ] | |
print(colecao) |
This file contains 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
<?php | |
class Chat | |
{ | |
private $Rooms = []; | |
public function createRoom($Name) | |
{ | |
$RoomID = md5($Name); | |
$this->Rooms[$RoomID] = new Room($Name); | |
} |
This file contains 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
<?php | |
class AgendaContatos | |
{ | |
private $Nome = ""; | |
private $Email = ""; | |
private $Telefones = array(); | |
private $Celulares = array(); | |
public function getNome() { return $this->Nome; } |
This file contains 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
<?php | |
function ColocaEspacos($Titulo = null, $Valor = null) | |
{ | |
$Qnt = 20; | |
$Espacos = ""; | |
if ( $Titulo == null ) | |
{ | |
for ( $i = 0; $i < $Qnt; $i++ ) | |
{ |