<jupyter_start><jupyter_text>Type<jupyter_code>x = 3
y = 'test'
print(type(x), type(y))<jupyter_output><class 'int'> <class 'str'><jupyter_text>Métodos string<jupyter_code>'test'.islower()<jupyter_output><empty_output><jupyter_text>- dica: usar o tab para autocompletar método  Print<jupyter_code>x = 30
nome = 'Glauber'
print('Oi, meu nome é {} e tenho {} anos'.format(nome, x))<jupyter_output>Oi, meu nome é Glauber e tenho 30 anos<jupyter_text>Lista<jupyter_code>lista = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
lista[0][2]
lista.append([10, 11, 12])
lista
lista.pop()
lista
[1, 2, 3] in lista
[1, 4, 8] in lista<jupyter_output><empty_output><jupyter_text>"Ponteiros"<jupyter_code>arr = [1, 2, 3 ,4 ]
arr
arr2 = arr
arr2
arr2[2] =  5
arr2
arr<jupyter_output><empty_output><jupyter_text>resolvendo com copy<jupyter_code>arr2 = arr.copy()
arr2[2] =  10
arr
arr2<jupyter_output><empty_output><jupyter_text>Slice<jupyter_code>lista2 = [1, 2, 3, 4, 5, 6]
lista2[3:6] #Não pega o ultimo valor
lista2[:4]<jupyter_output><empty_output><jupyter_text>Dictionary<jupyter_code>dic = {'nome': 'Glauber', 'idade': 30}
dic['nome']
dic['idade']<jupyter_output><empty_output><jupyter_text>Tupla<jupyter_code>tup = (1, 2, 3)
tup[0]<jupyter_output><empty_output><jupyter_text>* Tupla são imutáveis  if elif else<jupyter_code>x = 5
if x < 5 :
    print('x < 5')
elif x == 5:
    print('x == 5')
else:
    print('x > 5 ')<jupyter_output>x == 5<jupyter_text>For<jupyter_code>seq = [0, 1, 2, 3, 4, 5]
for item in seq:
    print(item)
for i in range(0,6):
    print(i)<jupyter_output>0
1
2
3
4
5<jupyter_text>While<jupyter_code>i = 0
while i < 6:
    print(i)
    i+=1<jupyter_output>0
1
2
3
4
5<jupyter_text>List comprehensions<jupyter_code>x = [0, 1, 2, 3, 4, 5]
[item**2 for item in x]<jupyter_output><empty_output><jupyter_text>Função<jupyter_code>def bhaskara(a, b, c):
    d = b**2 - 4 * a * c
    x1 = (-b + d**(1/2))/( 2*a )
    x2 = (-b - d**(1/2))/( 2*a )
    return [x1, x2]

bhaskara(1, 1, -6)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17787742899850523, 'fraction_numerical': 0.05680119581464873, 'mean_word_length': 5.806779661016949, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '14', 'dir': 'jupyter-structured-clean-dedup', 'id': '16246', 'license': 'MIT', 'n_tokens_mistral': 1024, 'n_tokens_neox': 970, 'n_words': 193, 'path': 'python-data-science-machine-learning/1-minicurso-python/basic.ipynb', 'repo_name': 'GlauberC/udemy-cursos', 'size': '2007'}