Skip to content

Commit b5dff75

Browse files
authored
Merge pull request mouredev#4544 from JesusAntonioEEscamilla/JesusAEE
#2 - Java y Python "Extra"
2 parents 2ded56e + 8730614 commit b5dff75

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

Roadmap/02 - FUNCIONES Y ALCANCE/java/JesusAntonioEEscamilla.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ public static void main(String[] args) {
1919
System.out.println("La resta es " + resultados[0] + " y la division es " + resultados[1]);
2020
// Variables Global y Local
2121
my_Function();
22+
23+
//EXTRA
24+
EXTRA("FIZZ", "BUZZ");
2225
}
2326

2427
// Función Básica
@@ -63,7 +66,22 @@ public static void my_Function(){
6366

6467
/**-----DIFICULTAD EXTRA-----*/
6568

66-
// Pendiente
69+
public static int EXTRA(String text1, String text2){
70+
int cont = 0;
71+
for(int number = 1; number <= 100; number++){
72+
if (number % 3 == 0 && number % 5 == 0) {
73+
System.out.println(text1 + text2);
74+
} else if(number % 3 == 0){
75+
System.out.println(text1);
76+
} else if(number % 5 == 0){
77+
System.out.println(text2);
78+
} else {
79+
System.out.println(number);
80+
}
81+
cont++;
82+
}
83+
return cont;
84+
}
6785

6886
/**-----DIFICULTAD EXTRA-----*/
6987
}

Roadmap/02 - FUNCIONES Y ALCANCE/python/JesusAntonioEEscamilla.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,18 @@ def my_function():
5252
"""
5353
EXTRA
5454
"""
55+
def extra(text1, text2) -> int:
56+
cont = 0
57+
for number in range(1, 101):
58+
if number % 3 == 0 and number % 5 == 0:
59+
print(text1)
60+
elif number % 3 == 0:
61+
print(text2)
62+
elif number % 5 == 0:
63+
print(text1 + text2)
64+
else:
65+
print(number)
66+
cont +=1
67+
return print(f"Las veces que aparece las letras {cont}")
68+
69+
extra("FIZZ","BUZZ")

0 commit comments

Comments
 (0)