
ALT require 'date' Date.parse('000102') # #<Date: 2000-01-02 ..> Date.parse('990102') # #<Date: 1999-01-02 ..> Date.parse('680102') # #<Date: 2068-01-02 ..> Date.parse('690102') # #<Date: 1969-01-02 ..> Date.strptime('68-01-02') # #<Date: 0068-01-02 ..> Date.strptime('69-01-02') # #<Date: 0069-01-02 ..>
![array = 1, 2, 3, 4, 5, 6
# Décomposition d'un tableau
a, b = array # a = 1, b = 2
a, *b = array # a = 1, b = [2, 3, 4, 5, 6]
a, *b, c = array # a = 1, b = [2, 3, 4, 5], c = 6
*b, c = array # b = [1, 2, 3, 4, 5], c = 6
*a, *b = array # SyntaxError
# Merge d'un tableau
[0, array, 7, 8] # [0, [1, 2, 3, 4, 5, 6], 7, 8]
[0, *array, 7, 8] # [0, 1, 2, 3, 4, 5, 6, 7, 8]](https://pbs.twimg.com/media/F6S6ZWHWwAA1FGs.jpg?name=small&format=webp)
ALT array = 1, 2, 3, 4, 5, 6 # Décomposition d'un tableau a, b = array # a = 1, b = 2 a, *b = array # a = 1, b = [2, 3, 4, 5, 6] a, *b, c = array # a = 1, b = [2, 3, 4, 5], c = 6 *b, c = array # b = [1, 2, 3, 4, 5], c = 6 *a, *b = array # SyntaxError # Merge d'un tableau [0, array, 7, 8] # [0, [1, 2, 3, 4, 5, 6], 7, 8] [0, *array, 7, 8] # [0, 1, 2, 3, 4, 5, 6, 7, 8]

ALT # Mode par défaut est :up en Ruby => le plus éloigné de 0 2.5.round # 3 -2.5.round # -3 # Le mode :down => le plus proche de 0 2.5.round(half: :down) # 2 -2.5.round(half: :down) # -2 # Le mode :even (celui par défaut de Python) => le nombre pair le plus proche (pour une équité statistique) 2.5.round(half: :even) # 2 -2.5.round(half: :even) # -2 3.5.round(half: :even) # 4






![[2, 3, 1].min # 1
(1..3).max # 3
{b: 1, a: 2, c: 3}.min # [:a, 2]
Struct.new(:b, :c).new(2, 3).max # 3
[].min # nil](https://pbs.twimg.com/media/F7a-LqVWoAAH2_l.jpg?name=small&format=webp)
![str = "Hello World!"
# one character
str.slice(1) # "e"
str[1] # "e"
str[-1] # "!"
str[99] # nil
# specific length
str[2, 3] # "llo"
str[-6, 5] # "World"
# range
str[2..4] # "llo"
str[-6..-2] # "World"](https://pbs.twimg.com/media/F63I6w1WgAAb8MS.jpg?name=small&format=webp)






