3
3
{
4
4
"cell_type" : " markdown" ,
5
5
"metadata" : {
6
- "id" : " view-in-github"
6
+ "id" : " view-in-github" ,
7
+ "colab_type" : " text"
7
8
},
8
9
"source" : [
9
- " <a href=\" https://colab.research.google.com/github/metsumesquita/Python_resumo/blob/main/ESTUDO_DE_PYTHON .ipynb\" target=\" _parent\" ><img src=\" https://colab.research.google.com/assets/colab-badge.svg\" alt=\" Open In Colab\" /></a>"
10
+ " <a href=\" https://colab.research.google.com/github/metsumesquita/Python_resumo/blob/main/ESTUDO_DE_PYTHON_ .ipynb\" target=\" _parent\" ><img src=\" https://colab.research.google.com/assets/colab-badge.svg\" alt=\" Open In Colab\" /></a>"
10
11
]
11
12
},
12
13
{
32
33
},
33
34
{
34
35
"cell_type" : " code" ,
35
- "execution_count" : 3 ,
36
+ "execution_count" : null ,
36
37
"metadata" : {
37
38
"id" : " fnjTKFkCu0nx"
38
39
},
43
44
},
44
45
{
45
46
"cell_type" : " code" ,
46
- "execution_count" : 4 ,
47
+ "execution_count" : null ,
47
48
"metadata" : {
48
49
"id" : " llWCVCCyS2DW"
49
50
},
1132
1133
" print(elevar)"
1133
1134
]
1134
1135
},
1135
- {
1136
- "cell_type" : " markdown" ,
1137
- "metadata" : {
1138
- "id" : " QyuPhr8rAaS-"
1139
- },
1140
- "source" : []
1141
- },
1142
1136
{
1143
1137
"cell_type" : " code" ,
1144
1138
"execution_count" : null ,
1683
1677
" #esse o ano é bissexto"
1684
1678
]
1685
1679
},
1680
+ {
1681
+ "cell_type" : " markdown" ,
1682
+ "source" : [
1683
+ " ##numeros interios ou float"
1684
+ ],
1685
+ "metadata" : {
1686
+ "id" : " H58t1a6Vumv_"
1687
+ }
1688
+ },
1689
+ {
1690
+ "cell_type" : " code" ,
1691
+ "source" : [
1692
+ " \n " ,
1693
+ " numero =input(\" infome um numero qualquer\" )\n " ,
1694
+ " divisor= input(\" informe um valor para dividir o numero qualquer que voce informou\" )\n " ,
1695
+ " \n " ,
1696
+ " if numero%divisor==0 :\n " ,
1697
+ " print(\" Este número: \" + str(numero) + \" é divisível por \" + str(divisor))\n " ,
1698
+ " else :\n " ,
1699
+ " print(\" este numero: \" + str(numero) + \" não divisivel por \" + str(divisor))\n " ,
1700
+ " \n "
1701
+ ],
1702
+ "metadata" : {
1703
+ "colab" : {
1704
+ "base_uri" : " https://localhost:8080/" ,
1705
+ "height" : 245
1706
+ },
1707
+ "id" : " csMaEnRMuy7i" ,
1708
+ "outputId" : " 8e5a0bdb-1175-46c5-8f57-b92ab0c14349"
1709
+ },
1710
+ "execution_count" : null ,
1711
+ "outputs" : [
1712
+ {
1713
+ "name" : " stdout" ,
1714
+ "output_type" : " stream" ,
1715
+ "text" : [
1716
+ " infome um numero qualquer30\n " ,
1717
+ " informe um valor para dividir o numero qualquer que voce informou3\n "
1718
+ ]
1719
+ },
1720
+ {
1721
+ "output_type" : " error" ,
1722
+ "ename" : " TypeError" ,
1723
+ "evalue" : " not all arguments converted during string formatting" ,
1724
+ "traceback" : [
1725
+ " \u001b [0;31m---------------------------------------------------------------------------\u001b [0m" ,
1726
+ " \u001b [0;31mTypeError\u001b [0m Traceback (most recent call last)" ,
1727
+ "\u001b[0;32m<ipython-input-19-414d8d89e0c1>\u001b[0m in \u001b[0;36m<cell line: 4>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0mdivisor\u001b[0m\u001b[0;34m=\u001b[0m \u001b[0minput\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"informe um valor para dividir o numero qualquer que voce informou\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 4\u001b[0;31m \u001b[0;32mif\u001b[0m \u001b[0mnumero\u001b[0m\u001b[0;34m%\u001b[0m\u001b[0mdivisor\u001b[0m\u001b[0;34m==\u001b[0m\u001b[0;36m0\u001b[0m \u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 5\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Este número: \"\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0mstr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnumero\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;34m\" é divisível por \"\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0mstr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdivisor\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 6\u001b[0m \u001b[0;32melse\u001b[0m \u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
1728
+ " \u001b [0;31mTypeError\u001b [0m: not all arguments converted during string formatting"
1729
+ ]
1730
+ }
1731
+ ]
1732
+ },
1686
1733
{
1687
1734
"cell_type" : " markdown" ,
1688
1735
"metadata" : {
3052
3099
"id" : " s0b6x1-XRSa9"
3053
3100
},
3054
3101
"source" : [
3055
- " #FIFO FALTA"
3102
+ " #FIFO (First In, First Out) FALTA\n " ,
3103
+ " ####não necessamente é uma lista\n " ,
3104
+ " \n " ,
3105
+ " \n " ,
3106
+ " FALTAAA"
3056
3107
]
3057
3108
},
3109
+ {
3110
+ "cell_type" : " code" ,
3111
+ "source" : [
3112
+ " # https://www.otaviomiranda.com.br/2020/filas-em-python-com-deque-queue/\n " ,
3113
+ " #https://www.oreilly.com/library/view/python-cookbook/0596001673/ch17s15.html\n " ,
3114
+ " # https://medium.com/@khasnobis.sanjit890/linear-data-structure-queue-in-python-fifo-first-in-first-out-bbd03f6b3b0f\n " ,
3115
+ " #https://www.simplilearn.com/tutorials/python-tutorial/queue-in-python#:~:text=Python%20list%20is%20used%20as,to%20maintain%20the%20FIFO%20manner."
3116
+ ],
3117
+ "metadata" : {
3118
+ "id" : " FOOPAX0gaaTK"
3119
+ },
3120
+ "execution_count" : null ,
3121
+ "outputs" : []
3122
+ },
3058
3123
{
3059
3124
"cell_type" : " markdown" ,
3060
3125
"metadata" : {
3622
3687
" #modificamos o parametro que quebra do nosso string\n " ,
3623
3688
" def get_mail(string):\n " ,
3624
3689
" li = list(string.split(\" @\" ))\n " ,
3625
- " #pegamos a 2 parte da saber o tipo da fonte de email \n " ,
3690
+ " #pegamos a 2 parte da saber o tipo da fonte de email\n " ,
3626
3691
" return li[1]\n " ,
3627
3692
" #retornamos o tipo\n " ,
3628
3693
" \n " ,
3638
3703
{
3639
3704
"cell_type" : " code" ,
3640
3705
"execution_count" : null ,
3641
- "metadata" : {},
3706
+ "metadata" : {
3707
+ "id" : " Kj2CB7vxXYnM"
3708
+ },
3642
3709
"outputs" : [],
3643
3710
"source" : [
3644
3711
" # Definição do dicionário de produtos e listas de itens\n " ,
3692
3759
" return i\n " ,
3693
3760
" else:\n " ,
3694
3761
" return -1\n " ,
3695
- " \n " ,
3762
+ " \n " ,
3696
3763
" # Função para calcular o preço da bebida com base na quantidade\n " ,
3697
3764
" def calcular_preço_bebida(posição):\n " ,
3698
3765
" qtd = int(input(\" Informe a quantidade do item que você deseja: \" ))\n " ,
3720
3787
" print(f\" O valor total para {escolhido} é: R${totalB:.2f}\" )\n " ,
3721
3788
" else:\n " ,
3722
3789
" print(\" Item não encontrado na lista de bebidas.\" )\n " ,
3723
- " \n " ,
3790
+ " \n " ,
3724
3791
" elif opçãolista == 2:\n " ,
3725
3792
" escolhido = input(\" Informe por escrito qual o nome do item selecionado: \" )\n " ,
3726
3793
" posição = itemPosiçãoC(escolhido)\n " ,
3957
4024
" np.linspace(0., 8., 6)\n "
3958
4025
]
3959
4026
},
4027
+ {
4028
+ "cell_type" : " code" ,
4029
+ "source" : [],
4030
+ "metadata" : {
4031
+ "id" : " HkHS5NkFhk_Y"
4032
+ },
4033
+ "execution_count" : null ,
4034
+ "outputs" : []
4035
+ },
3960
4036
{
3961
4037
"cell_type" : " code" ,
3962
4038
"execution_count" : null ,
4920
4996
" return \" <p>Hello, World!</p>\" "
4921
4997
]
4922
4998
},
4999
+ {
5000
+ "cell_type" : " markdown" ,
5001
+ "source" : [
5002
+ " REDES NEURAIS\n " ,
5003
+ " https://medium.com/geekculture/understanding-the-basics-of-neural-networks-for-beginners-9c26630d08\n " ,
5004
+ " https://machinelearningmastery.com/implement-perceptron-algorithm-scratch-python/\n " ,
5005
+ " https://www.simplilearn.com/tutorials/deep-learning-tutorial/neural-network\n "
5006
+ ],
5007
+ "metadata" : {
5008
+ "id" : " iON51fPHBCH6"
5009
+ }
5010
+ },
5011
+ {
5012
+ "cell_type" : " code" ,
5013
+ "source" : [],
5014
+ "metadata" : {
5015
+ "id" : " Bwkt1psWBCej"
5016
+ },
5017
+ "execution_count" : null ,
5018
+ "outputs" : []
5019
+ },
5020
+ {
5021
+ "cell_type" : " code" ,
5022
+ "source" : [],
5023
+ "metadata" : {
5024
+ "id" : " SW9Hr3hXBDDz"
5025
+ },
5026
+ "execution_count" : null ,
5027
+ "outputs" : []
5028
+ },
5029
+ {
5030
+ "cell_type" : " code" ,
5031
+ "source" : [],
5032
+ "metadata" : {
5033
+ "id" : " AmP6Vwk5BC1K"
5034
+ },
5035
+ "execution_count" : null ,
5036
+ "outputs" : []
5037
+ },
5038
+ {
5039
+ "cell_type" : " markdown" ,
5040
+ "source" : [
5041
+ " #criando arquivos aparti deste"
5042
+ ],
5043
+ "metadata" : {
5044
+ "id" : " veL3Yb0oZFYO"
5045
+ }
5046
+ },
5047
+ {
5048
+ "cell_type" : " code" ,
5049
+ "source" : [
5050
+ " import nbformat\n " ,
5051
+ " \n " ,
5052
+ " # Caminho para o arquivo do notebook\n " ,
5053
+ " file_path = \" /mnt/data/ESTUDO_DE_PYTHON_.ipynb\"\n " ,
5054
+ " \n " ,
5055
+ " # Carregando o notebook\n " ,
5056
+ " with open(file_path, \" r\" , encoding=\" utf-8\" ) as file:\n " ,
5057
+ " notebook = nbformat.read(file, as_version=4)\n " ,
5058
+ " \n " ,
5059
+ " # Verificando as seções (células) do notebook\n " ,
5060
+ " notebook_cells = notebook.cells\n " ,
5061
+ " len(notebook_cells), notebook_cells[0], notebook_cells[-1]\n "
5062
+ ],
5063
+ "metadata" : {
5064
+ "id" : " BUXq77YdZIvd"
5065
+ },
5066
+ "execution_count" : null ,
5067
+ "outputs" : []
5068
+ },
5069
+ {
5070
+ "cell_type" : " code" ,
5071
+ "source" : [
5072
+ " # Função para criar um novo notebook com um subconjunto de células\n " ,
5073
+ " def create_notebook(cells, path):\n " ,
5074
+ " new_notebook = nbformat.v4.new_notebook()\n " ,
5075
+ " new_notebook.cells = cells\n " ,
5076
+ " with open(path, 'w', encoding='utf-8') as f:\n " ,
5077
+ " nbformat.write(new_notebook, f)\n " ,
5078
+ " \n " ,
5079
+ " # Dividindo as células em três partes\n " ,
5080
+ " part1_cells = notebook_cells[:76]\n " ,
5081
+ " part2_cells = notebook_cells[76:152]\n " ,
5082
+ " part3_cells = notebook_cells[152:]\n " ,
5083
+ " \n " ,
5084
+ " # Caminhos para os novos arquivos\n " ,
5085
+ " part1_path = \" /mnt/data/ESTUDO_DE_PYTHON_part1.ipynb\"\n " ,
5086
+ " part2_path = \" /mnt/data/ESTUDO_DE_PYTHON_part2.ipynb\"\n " ,
5087
+ " part3_path = \" /mnt/data/ESTUDO_DE_PYTHON_part3.ipynb\"\n " ,
5088
+ " \n " ,
5089
+ " # Criando os novos notebooks\n " ,
5090
+ " create_notebook(part1_cells, part1_path)\n " ,
5091
+ " create_notebook(part2_cells, part2_path)\n " ,
5092
+ " create_notebook(part3_cells, part3_path)\n " ,
5093
+ " \n " ,
5094
+ " part1_path, part2_path, part3_path\n "
5095
+ ],
5096
+ "metadata" : {
5097
+ "id" : " ihVx3DA-ZL8E"
5098
+ },
5099
+ "execution_count" : null ,
5100
+ "outputs" : []
5101
+ },
4923
5102
{
4924
5103
"cell_type" : " markdown" ,
4925
5104
"metadata" : {
5007
5186
"metadata" : {
5008
5187
"colab" : {
5009
5188
"provenance" : [],
5010
- "toc_visible " : true
5189
+ "include_colab_link " : true
5011
5190
},
5012
5191
"kernelspec" : {
5013
5192
"display_name" : " Python 3" ,
5028
5207
},
5029
5208
"nbformat" : 4 ,
5030
5209
"nbformat_minor" : 0
5031
- }
5210
+ }
0 commit comments