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
escritor = 'Fyodor Mikhailovich Dostoevsky' | |
cadenaInvertida = escritor[::-1] | |
print(cadenaInvertida) |
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 class LibroCalificaciones | |
{ | |
// Variables de instancia | |
private String nombreDelCurso; | |
private String nombreDelInstructor; | |
// Constructor inicialización de variables de instancia | |
public LibroCalificaciones( String curso, String nombre ) | |
{ | |
// Asigna a la var. de inst. nombreDelCurso el valor del parámetro curso |
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
# Ejercicio 330: Usar el método de Criba de Eratóstenes para generar números primos hasta n. | |
def criba_eratostenes(n): | |
primos = [] | |
no_primos = [] | |
for i in range(2, n + 1): | |
if i not in no_primos: | |
primos.append(i) |
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 json | |
import os | |
import time | |
import webbrowser | |
import sys | |
import re | |
def handleWindows(extra_seconds): | |
print("OS : Windows") |
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
using System; | |
namespace Articulo.Pregunta.P1420 | |
{ | |
public class CalculoEdad | |
{ | |
public static void Main() | |
{ | |
Console.WriteLine ("\nLa edad para alguien que haya nacido en 1989/13/1 es: {0} años.\n", | |
CalcularEdad(DateTime.Parse("1/13/1989"))); |
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 class Fecha | |
{ | |
// Variables de instancia (o piezas de información) | |
private int dia; // Día del año (formato numérico) | |
private int mes; // Mes del año (formato numérico) | |
private int annio; // Mes del año | |
// Constructor para inicializar las variables de instancia | |
public Fecha( int pMes , int pDia , int pAnnio ) | |
{ |
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 React from 'react'; | |
import { Text, View } from 'react-native'; | |
import { NativeRouter, Switch, Route, Redirect } from 'react-router-native'; | |
const HomeScreen = () => ( | |
<View> | |
<Text>Welcome to the home screen!</Text> | |
</View> | |
); | |
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
from google.oauth2.credentials import Credentials | |
from googleapiclient.discovery import build | |
from googleapiclient.errors import HttpError | |
from google.oauth2 import service_account | |
def get_service(api_name, api_version, scopes, key_file_location): | |
"""Get a service that communicates to a Google API. | |
Args: |
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; | |
// Declaración de clase definida por el programador | |
public class Circulo | |
{ | |
// Método de clase o método estático | |
public static void main( String[] args ) | |
{ | |
int radio; // Almacena el radio del círculo | |
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 | |
# Definición diccionario: | |
diccionario = {'pares': [0, 2, 4, 6], 'impares': [1, 3, 5, 7]} | |
# Creación DataFrame: | |
df_numeros = pd.DataFrame(diccionario) | |
# Guarda datos en CSV: | |
df_numeros.to_csv('numeros.csv', header=False, index=False) |
NewerOlder