Skip to content

Instantly share code, notes, and snippets.

View daviwesley's full-sized avatar
😃
let's code!

Davi Wesley daviwesley

😃
let's code!
  • Netherrealm
View GitHub Profile
def validar_cpf(cpf):
digitos = [int(c) for c in cpf if c.isdigit()]
if len(digitos) == 11:
a, b, c, d, e, f, g, h, i, j, k = digitos
numeros = [a, b, c, d, e, f, g, h, i]
r = range(10, 1, -1)
soma = sum([x * y for x, y in zip(numeros, r)])
resto = soma % 11
dv1 = (11 - resto if 11 - resto < 10 else 0)
numeros = [a, b, c, d, e, f, g, h, i, dv1]
opcao = 0
while opcao != 6:
print(''' [1] Criar aquivo
[2] Apagar aquivo
[3] Ler aquivo
[4] Gravar aquivo
[5] Inserir conteúdo no final do aquivo
[6] Sair
''')
opcao = int(input("Qual é sua opção?"))
'''
Trabalho 3: Alocação de Arquivos
Alunos: Davi Wesley e Tayar Santiago
OBS:
não se fez uso de matrizes porque no python não existe, ao invés foram
usadas estruturas de dados mais modernas como dicionarios, listas e listas de listas.
como executar?
'python3 nome.py'
from django.db import models
# Create your models here.
class Subject(models.Model):
name = models.CharField(max_length=40)
hours = models.IntegerField()
credits = models.IntegerField()
"transform": {
"^.+\\.js$": "<rootDir>/node_modules/react-native/jest/preprocessor.js"
}
"transform": {
"^.+\\.js$": "<rootDir>/node_modules/react-native/jest/preprocessor.js"
}
class QLearning():
def __init__(self):
self.self.matrizQ = [[0]*5 for x in range(5)]
self.learningRate = 0.9
self.discountRate = 0
self.indiceAcaoAtual = 2
self.indiceEstadoAtual = 0

{ user(login: "daviwesley") { repositories(first: 10,privacy: PUBLIC) { totalCount edges { node { name description createdAt }

tabela = {
0: {"digito": 1, 'other': 'qrej', "e": "qrej"},
1: {"digito": 1, '.': 2, "e": 2},
2: {"other": "qrej", "digito": 3, "e": 4},
3: {"digito": 3, "e": 4, "other": "qf1"},
4: {"other": "qrej", "+": 5, "-": 5},
5: {"other": "qrej", "digito": 6},
6: {"digito": 6, "other": "qrej"},
"qrej": "qrej",
"qf1": "qf1"
import { Component, OnInit } from "@angular/core";
import Map from "ol/Map";
import Tile from "ol/layer/Tile";
import OSM from "ol/source/OSM";
import View from "ol/View";
import { fromLonLat, toLonLat } from "ol/proj.js";
import { Tile as TileLayer, Vector as VectorLayer } from "ol/layer.js";
import { MatDialog, MatDialogConfig } from "@angular/material/dialog";
import { FiltroDialogComponent } from "../filtro-dialog/filtro-dialog.component";
import Polyline, { encodeDeltas } from "ol/format/Polyline.js";