Skip to content

Instantly share code, notes, and snippets.

View chinbrow's full-sized avatar

Luis Gonzalez chinbrow

View GitHub Profile
import java.util.Scanner;
public class Desviacion {
public static void main(String[] args){
Scanner userInputScanner = new Scanner(System.in);
System.out.println("Calculemos la desviacion estándar y la media");
double total = 0;
double totalis = 0;
for(int x = 0; x < 10; ++x) {
import java.util.Scanner;
public class Bisiesto {
public static void main(String[] args){
Scanner userInputScanner = new Scanner(System.in);
System.out.println("Calcula el año Bisiesto");
System.out.println("¿Qué año? ");
int año = userInputScanner.nextInt();
def mean(liston):
a = 1
b = 0
if liston == 0:
return 0
else:
for i in range(liston-1):
a,b= a+b,a
return a
f = open("93cars.txt.pages")
scan = f.readlines()
scan = scan [::2]
city_unit = 0
highway_unit = 0
midprice_unit = 0
city_set = 0
highway_set = 0
price_set = 0
string = ''
x = input("Give me your name")
print ("Hello ", x)
def calculate_e(y):
num = 0
e = 2.718281828459045235360
e = str(e)
while num != y+2:
print(e[num])
num += 1
return e
precision = float(input("enter decimal points: "))
def longest(a):
b = ""
c = 0
for i in a:
if len(i)>=c:
c = len(i)
b = i
return b
def longer_than(a,b):
a_list = []
for i in a:
if len(i)>=b:
a_list.append(i)
return a_list
c = int(input("The minimum number of characters: "))
a_list = []
num_nums = int(input("How many words in list to compare? "))
def mymax(x,y):
return max(x,y)
def word_to_num(a):
a_list = []
for i in a:
num = len(i)
a_list.append(num)
return a_list
from functools import reduce
def mymax(x,y):
return max(x,y)
def mymin(x,y):
return min(x,y)
a_list = []
num_nums = int(input("How many numbers in list? "))
for i in range(num_nums):