Skip to content

Commit

Permalink
created javakata.java
Browse files Browse the repository at this point in the history
  • Loading branch information
JaumeOS committed Dec 23, 2022
1 parent 0fced47 commit dfaccc9
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 22 deletions.
Empty file added conditions.py
Empty file.
12 changes: 12 additions & 0 deletions javakata.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
public class SquareDigit {

public int squareDigits(int n) {
// separar cada dígito de n
List<Integer> listn = new List<Integer>();
for (x = 0; x < n.length; x++){
listn.add(x);
}
// recorrer listn para comprobar cuantos dígitos tiene
}

}
28 changes: 14 additions & 14 deletions lists.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# x = object()
# y = object()
x = object()
y = object()

# x_list = [x] * 10
# y_list = [y] * 10
# big_list = []
x_list = [x] * 10
y_list = [y] * 10
big_list = []

# big_list = x_list + y_list
big_list = x_list + y_list

# print("x_list contains %d objects" % len(x_list))
# print("y_list contains %d objects" % len(y_list))
# print("big_list contains %d objects" % len(big_list))
print("x_list contains %d objects" % len(x_list))
print("y_list contains %d objects" % len(y_list))
print("big_list contains %d objects" % len(big_list))

# # List().count(x) cuenta el número de items que hay con el valor x en la lista
# if x_list.count(x) == 10 and y_list.count(y) == 10:
# print("Almost there...")
# if big_list.count(x) == 10 and big_list.count(y) == 10:
# print("Great!")
# List().count(x) cuenta el número de items que hay con el valor x en la lista
if x_list.count(x) == 10 and y_list.count(y) == 10:
print("Almost there...")
if big_list.count(x) == 10 and big_list.count(y) == 10:
print("Great!")
16 changes: 8 additions & 8 deletions string_operators.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# nombre = 'Jaume'
# altura = 1.73
# print('Nombre: %s, altura: %.2f' % (nombre, altura))

# data = ('Jaume', 'Ordinas', 100.77)
# format_string = 'Hello %s %s. Your current balance is $%s.'
# print(format_string % data)
# ## print(format_string, data[0], data[1] + '. Your current height is %.2fm' % data[2])
nombre = 'Jaume'
altura = 1.73
print('Nombre: %s, altura: %.2f' % (nombre, altura))

data = ('Jaume', 'Ordinas', 100.77)
format_string = 'Hello %s %s. Your current balance is $%s.'
print(format_string % data)
## print(format_string, data[0], data[1] + '. Your current height is %.2fm' % data[2])

text = "abcdefghi"
# text[start:stop:step]
Expand Down

0 comments on commit dfaccc9

Please sign in to comment.