Run the below command in terminal:
wget --no-cache -O - https://gist.github.com/EmpireWorld/737fbb9f403d4dd66dee1364d866ba7e/raw/install-lamp.sh | bash
#1. Crear script Sh en alguna ruta del sistema | |
#!/bin/bash | |
sudo apt update && sudo apt upgrade -y | |
echo "Actulizados los repositorios y paquetes del sistema" | |
exit | |
# 2. Darle permisos de ejecución al script (en la ruta que lo hayamos creado) | |
sudo chmod +x /root/actualizar-script.sh |
#1. Crear el script actualizar.sh | |
#!/bin/bash | |
sudo apt update && sudo apt upgrade -y | |
#2. Copiamos el script a una ubicación concreta. Para este caso /usr/local/bin | |
sudo cp actualizar.sh /usr/local/bin | |
#3. Le damos permisos de ejecución | |
sudo chmod +x /usr/local/bin/actualizar.sh |
{ | |
"workbench.activityBar.visible": true, | |
"editor.fontFamily": "Jetbrains Mono", | |
"editor.fontLigatures": true, | |
"editor.lineHeight": 23, | |
"workbench.editor.tabSizing": "shrink", | |
"editor.tabSize": 4, | |
"editor.insertSpaces": true, | |
"editor.cursorWidth": 5, | |
"editor.cursorStyle": "line", |
{"lastUpload":"2021-02-18T19:41:27.202Z","extensionVersion":"v3.4.3"} |
text = """ | |
The Zen of Python, by Tim Peters | |
Beautiful is better than ugly. | |
Explicit is better than implicit. | |
Simple is better than complex. | |
Complex is better than complicated. | |
Flat is better than nested. | |
Sparse is better than dense. | |
Readability counts. |
from string import ascii_lowercase | |
text = """ | |
One really nice feature of Python is polymorphism: using the same operation | |
on different types of objects. | |
Let's talk about an elegant feature: slicing. | |
You can use this on a string as well as a list for example | |
'pybites'[0:2] gives 'py'. | |
The first value is inclusive and the last one is exclusive so | |
here we grab indexes 0 and 1, the letter p and y. |
def persistence(n): | |
from functools import reduce # Es necesario importar esta libreria del sistema | |
l = [int(x) for x in str(n)] | |
if len(l) == 1: | |
return(0) | |
else: | |
count = 0 | |
while True: | |
l2 = reduce(lambda x, y: x * y, l) |
def iq_test(numbers): | |
l = numbers.split(' ') | |
l2 = [int(n) for n in l] | |
odd_list = [l2.index(n) for n in l2 if n % 2 != 0] | |
even_list = [l2.index(x) for x in l2 if x % 2 == 0] | |
if len(odd_list) == 1: | |
odd_index = odd_list[0] + 1 | |
return odd_index | |
else: | |
even_index = even_list[0] + 1 |
// Instructions | |
// Write a function that takes a single string (word) as argument. The function must return an ordered list containing the indexes of all capital letters in the string. | |
// Test.assertSimilar( capitals('CodEWaRs'), [0,3,4,6] ); | |
const capital = function(word) { | |
const arr = word.split(""); | |
const arrOrdened = arr.map(function(e, i, a) { | |
if (e === e.toUpperCase()) { |