This is my solution for the challengue "if/else", I'm not a bigger fan of this sentence, so... I coded my solution only using ifs and creating a function validator.
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Cursos gratis de programacion</title> | |
</head> | |
<body> | |
<section> |
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
public boolean eliminarNodo(int elem) { | |
if (estaVacia()) return false; | |
if (inicio == fin && elem == inicio.dato) { | |
inicio = fin = null; | |
return true; | |
} | |
if (elem == inicio.dato) { |
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
nombres = input("Ingresa los nombres, separados por coma: ").split(",") | |
nombre_a_buscar = input("Ingresa el nombre a buscar: ") | |
def buscar_nombre(nombre_buscar): | |
if any(nombre == nombre_buscar for nombre in nombres): | |
return f"nombre encontrado {nombre_buscar}" | |
return f"No se encontro el nombre {nombre_buscar}" | |
print(buscar_nombre(nombre_a_buscar)) |
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 java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
float[] notes = new float[3]; | |
String name; | |
Scanner scann = new Scanner(System.in); | |
System.out.println("Ingrese el nombre del alumno"); |
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
'use strict'; | |
const testArray = [1, 'hello', 2, 'world'] | |
const onlyStrings = [] | |
testArray | |
.filter(n => typeof n === 'string') | |
.map(n => onlyStrings.push(n)) | |
console.log(onlyStrings) |
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 java.util.Scanner; | |
public class Main { | |
public static Scanner sc = new Scanner(System.in); | |
public static void main(String[] args) { | |
System.out.println(mensajesOpcionales()); | |
} |
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
--- | |
BasedOnStyle: Microsoft | |
AlignAfterOpenBracket: Align | |
AlignConsecutiveMacros: "true" | |
AlignConsecutiveAssignments: "true" | |
AlignConsecutiveDeclarations: "true" | |
AlignEscapedNewlines: Left | |
AlignOperands: "true" | |
AlignTrailingComments: "true" | |
AllowAllArgumentsOnNextLine: "true" |
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
package com.challenges.graphs; | |
public class Arista implements Comparable<Arista> { | |
private final Vertice vertice1; | |
private final Vertice vertice2; | |
private int peso; | |
public Arista(Vertice vertice1, Vertice vertice2) { | |
this(vertice1, vertice2, 1); | |
} |
OlderNewer