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 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) { |
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 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(); |
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 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 |
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
| 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 = '' |
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
| x = input("Give me your name") | |
| print ("Hello ", x) |
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 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: ")) |
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 longest(a): | |
| b = "" | |
| c = 0 | |
| for i in a: | |
| if len(i)>=c: | |
| c = len(i) | |
| b = i | |
| return b |
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 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? ")) |
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 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 |
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
| 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): |
NewerOlder