<jupyter_start><jupyter_text>Fuente https://www.w3schools.com/python/python_examples.asp<jupyter_code>#docstring
"""
Esto es para hacer
multilinea
"""
#mostrar
print("hello")<jupyter_output>hello<jupyter_text>variables<jupyter_code>x = 5
y = "Juan"
print(x)
print(y)<jupyter_output>5
Juan
<class 'int'>
<class 'float'>
<class 'complex'><jupyter_text>tipo de variable<jupyter_code>x1 = 1
y1 = 2.8
z1 = 1j
print(type(x1))
print(type(y1))
print(type(z1))<jupyter_output><class 'int'>
<class 'float'>
<class 'complex'><jupyter_text>numeracion cientifica<jupyter_code>x = 35e3
y = 12E4
z = -87.7e100

print(x)
print(type(x))
print(y)
print(type(y))
print(z)
print(type(z))<jupyter_output>35000.0
<class 'float'>
120000.0
<class 'float'>
-8.77e+101
<class 'float'><jupyter_text>cating int / convertir tipos a entero<jupyter_code>x = int(1)
y = int(2.8)
z = int("3")

print(x)
print(y)
print(z)<jupyter_output>1
2
3<jupyter_text>cast float / convertir a tipo flotante<jupyter_code>x = float(1)
y = float(2.8)
z = float("3")
w = float("2.3")

print(x)
print(y)
print(z)
print(w)<jupyter_output>1.0
2.8
3.0
2.3<jupyter_text>cast string & convertir a cadena o palabra<jupyter_code>x = str("1")
y = str(2)
z = str(3.0)

print(x)
print(y)
print(z)<jupyter_output>1
2
3.0<jupyter_text>String<jupyter_code>a = "la primera letra"
print(a[1])

b = "devuelve un substring"
print(b[2:5])

c = "   elimina los espacios al principio y al final    "
print(c.strip())

d = "longitud del string"
print(len(d))

e = "minusculas"
print(e.lower())

d = "mayusculas"
print(d.upper())

f = "reemplaza"
print(f.replace("reempl", "most"))

g = "corta, por un simbolo y devuelve un diccionario"
print(g.split(","))<jupyter_output>a
vue
elimina los espacios al principio y al final
19
minusculas
MAYUSCULAS
mostaza
['corta', ' por un simbolo y devuelve un diccionario']<jupyter_text>Operadores<jupyter_code>x = 5
y = 3

print(x + y)

x1 = 5
y1 = 3

print(x1 - y1)

x2 = 5
y2 = 3

print(x2 * y2)

x3 = 12
y3 = 3

print(x3 / y3)

x4 = 5
y4 = 2

print(x4 % y4)

#asignacions
x = 5

print(x)<jupyter_output>8
2
15
4.0
1
5
{'fraction_non_alphanumeric': 0.16402877697841728, 'fraction_numerical': 0.05467625899280575, 'mean_word_length': 5.539184952978056, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '9', 'dir': 'jupyter-structured-clean-dedup', 'id': '450713', 'license': 'MIT', 'n_tokens_mistral': 1050, 'n_tokens_neox': 1008, 'n_words': 209, 'path': 'python_basico.ipynb', 'repo_name': 'joniorulop/Python-Basico', 'size': '2085'}