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
class ListaPersonas(): | |
lista_personas = [] | |
def insertar(self, nombre, edad, sexo): | |
self.lista_personas.append([nombre, edad, sexo]) | |
def obtener_personas(self): | |
return self.lista_personas | |
def obtener_edades(self): | |
lista_edades = [] |
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 random | |
import csv | |
#Arreglo de buscaminas | |
buscaminas = [] | |
#Puntaje de jugadores | |
jugador1 = 0 | |
jugador2 = 0 | |
#Pasa turnos |
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
def decimal_binario(decimal): | |
binario = "" | |
#Aqui le decimos que si el cociente de la division (Este tipo de division devuelve un entero por cierto) | |
#es distinto de cero sigalo haciendo | |
#Tomando en cuenta que el decimal sea 10, el entero seria 5 el cual es diferente de 0 entonces: | |
while decimal // 2 != 0: | |
#Agarramos y para obtener el binario obtenemos el residuo y lo vamos acumulando | |
binario = binario + str(decimal % 2) | |
#Aqui lo que hacemos es que vamos cambiando el valor del decimal, o sea el residuo para dividirlo la siguiente vez, ademas | |
#como usted deberia saber porque teoricamente primero uno lo hace a mano, para formar el binario |
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 random | |
#Arreglo de buscaminas | |
buscaminas = [] | |
#Puntaje de jugadores | |
jugador1 = 0 | |
jugador2 = 0 | |
#Pasa turnos |
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
#Con esta calculamos todos los parametros donde V son los vertices, x coordenadas, y coordenadas y factor Fe | |
def calcularFenomeno(V, x, y, fe): | |
Xc = calcularXr(V, x, y, fe) | |
Yc = calcularYr(V, x, y, fe) | |
coordenadas = [Xc,Yc] | |
return coordenadas | |
#Con esto calculamos Xr | |
def calcularXr(V,x,y, fe): | |
Xr = 0 |
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
# ------- Bibliotecas | |
import random | |
import time | |
from tkinter import * | |
PASSWORD = '' |
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
# ------- Bibliotecas | |
import random | |
import time | |
import getpass | |
PASSWORD = '' |
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
# ------- Bibliotecas | |
import random | |
import time | |
# ---------------------------------- Funciones ---------------------------------- | |
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
# coding: utf-8 | |
# In[ ]: | |
# Proyecto 1 | |
# FUNCION PRINCIPAL (CAJERO) |
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
#Aqui es donde obtenemos la cantidad de personas | |
personas = int(input( "personas: ")) | |
#Aqui verificamos que la cantidad sea mayor a 0 si no, no tiene sentido pedir nada | |
while personas > 0: | |
#Le pedimos el nombre y lo guardamos en un input (Si usara Python 2.7 seria raw_input y no input pero usa python 3.7) | |
n = input("Su nombre por favor: ") | |
#Se pide al edad que siempre es un entero por eso el int() | |
e = int(input("Su edad en años por favor: ")) | |
#como la altura es en metros y no centimetros hay que ponerle punto y por ende es un flotante float() |