Skip to content

Commit

Permalink
daw1b pruebas en clase
Browse files Browse the repository at this point in the history
  • Loading branch information
dcsibon committed Nov 19, 2024
1 parent 2f39b53 commit 230c393
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
29 changes: 29 additions & 0 deletions pruebas/dam1_listas_tuplas.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,35 @@ def pausa():


def main():
limpiar_pantalla()

a = 7

print(f"{a:04d}")

return

mi_lista1 = [1, 2, (1, 2), 4]

mi_lista1[2].append(22)

res = ""
cont = 0
while cont < len(mi_lista1):
res += f"{mi_lista1[cont]}, "
cont += 1
print(res[:-2])


print(mi_lista1)





return


asignaturas = ["Mates", "Lengua", "Inglés", "Física", "Química", "Historia"]

limpiar_pantalla()
Expand Down
42 changes: 42 additions & 0 deletions pruebas/daw1b_pruebas.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import os


def borrar_consola():
os.system ("cls")


def pausar(salto_antes = True, limpiar_despues = True):
if salto_antes:
print()

os.system("pause")

if limpiar_despues:
borrar_consola()


def producto_escalar(vector1, vector2) -> int:
producto = 0
for i in range(len(vector1)):
producto += vector1[i] * vector2[i]


producto = 0
cont = 0
for elemento in vector1:
producto += elemento * vector2[cont]
cont += 1


def main():
borrar_consola()

vector1 = (1, 2, 3)
vector2 = (-1, 0, 2)

resultado = producto_escalar(vector1, vector2)



if __name__ == "__main__":
main()

0 comments on commit 230c393

Please sign in to comment.