So let's get started with programming, and programming is really the core computer science.
Most machines are designed to do just one thing.
This is supposed to be a toaster, more of a representational drawing than an accurate one.
And a toaster, we can do more than one thing with a toaster.
We can put different things in it. We can toast bread, we can toast muffins, maybe it has some things we can use to change its behavior a little bit.
We can turn a setting to make it toast for longer or shorter.
But it's pretty limited in what it can do. Everything it can do is a variation on this basic functionality that it was designed for:
this basic process of putting toast in, heating it up and getting the toast to pop out.
If we want to change its behavior to do something really different, we'd have to physically alter the machine.
We could maybe take the parts out, and put them together in a new way.
If we're really creative we could make a bicycle from the toaster. That would be a pretty big project, though.
So without a program a computer is even less useful than a toaster.
You can't do anything without a program.
The program is what tells the computer what to do.
And the power of the computer, is that, unlike a toaster, which is only designed to do a few things, a computer can do anything.
A computer is a universal machine. We can program it to do essentially any computation.
So anything that we can imagine, anything that we can figure out how to write a program for, we can make the computer do.
And what the program needs to be is a very precise sequence of steps.
The computer by itself doesn't know how to do anything. It has a few simple instructions that it can execute.
And to make a program do something useful we need to put those instructions together in a way that it does what we want.
So we can turn the computer into a web browser, into a server, into a game-playing machine, into a toaster, without anywhere to put the bread.
But it can do anything we can imagine: at least any computation we want to do.
The power of the computer is that it can execute the steps super super fast.
So we can execute billions of instructions in one second.
The program gives us a way to tell the computer what steps to take.
So there are many different languages for programming computers.
The language we are going to learn in this course is the language called Python, like the snake. It is also named after Monty Python.
The important thing about Python is that it gives us a nice high-level language that we can use to write programs.
And that means instead of our program running directly on the computer, the programs we write will be an input to the Python program which runs on the computer.
What Python is is called an interpreter. That means it runs our programs, it interprets them, executes the programs that we wrote in Python language by running a program in a language into the computer can understand directly.
0:00let's get started with programming and programming is really the core
0:03computer science
0:04most machines are designed to you just one thing
0:08this is supposed to be a toaster it's more for
0:11representation of drawing and an accurate one and a toaster
0:15well we can't do more than one thing with the tester maybe we can put
0:18different things and we can test
0:20bread we can test muffins maybe it has some things we can use to change its
0:25behavior low but we can turn a setting
0:27to make it toast for longer or shorter but it's pretty limited what it can do
0:31everything it can do
0:32is a variation on this basic functionality that was designed for
0:36this basic process putting toast in heating it up
0:39and getting that has to pop out if we want to change its behavior do something
0:44really different
0:45we have to physically alter the machine we could maybe take parts out put them
0:49together in a new way
0:50if we're really creative we could make a bicycle from the toaster
0:53that would be a a pretty big project go so without
0:57program computers even less useful than a toaster can't do anything with program
1:02the program is what else the computer what to do and the power of the computer
1:06is that unlike a toaster which is really designed to only do a few things
1:10a computer can do anything computers a universal machine
1:13we can program it to do you essentially any computation
1:17so anything that we can imagine anything that we can figure out how to write a
1:20program for
1:21we can make the computer deal and what the program needs to be is a very
1:25precise sequence of steps
1:26the computer by itself doesn't know how to do anything it has a few simple
1:30instructions
1:31that it can execute and to make a program do something useful
1:34we need to put those instructions together in a way that does what we want
1:38so we can turn the computer
1:39into a web browser into server into a game playing machine
1:44into a toaster without anywhere put the bread
1:47but into anything that we can imagine at least any computation we want to do.
1:52and the power the computers that can execute a steps
1:55super super fast so we can execute billions have instructions in one second
1:59the program
2:01give us a way to tell the computer what steps to take so they're many different
2:05languages
2:06for programming computers the language we're gonna learn this course the
2:09language cockpit fun
2:10like the snake it's awesome named after Monty Python
2:13and the important thing about Python is it gives us tonight high-level
2:17language that we can use to rate programs and that means instead of our
2:21program running
2:22directly on the computer the programs that we rate will be an import
2:25to the Python program which runs on the computer what I found is called an
2:29interpreter
2:30that means runs our programs it interprets them execute the program
2:34that we wrote in the Python language by running a program in the language that
2:38the computer
2:39can understand directly
So let's get started with programming, and programming is really the core computer science.
Most machines are designed to do just one thing.
This is supposed to be a toaster, more of a representational drawing than an accurate one.
And a toaster, we can do more than one thing with a toaster.
We can put different things in it. We can toast bread, we can toast muffins, maybe it has some things we can use to change its behavior a little bit.
We can turn a setting to make it toast for longer or shorter.
But it's pretty limited in what it can do. Everything it can do is a variation on this basic functionality that it was designed for:
this basic process of putting toast in, heating it up and getting the toast to pop out.
If we want to change its behavior to do something really different, we'd have to physically alter the machine.
We could maybe take the parts out, and put them together in a new way.
If we're really creative we could make a bicycle from the toaster. That would be a pretty big project, though.
So without a program a computer is even less useful than a toaster.
You can't do anything without a program.
The program is what tells the computer what to do.
And the power of the computer, is that, unlike a toaster, which is only designed to do a few things, a computer can do anything.
A computer is a universal machine. We can program it to do essentially any computation.
So anything that we can imagine, anything that we can figure out how to write a program for, we can make the computer do.
And what the program needs to be is a very precise sequence of steps.
The computer by itself doesn't know how to do anything. It has a few simple instructions that it can execute.
And to make a program do something useful we need to put those instructions together in a way that it does what we want.
So we can turn the computer into a web browser, into a server, into a game-playing machine, into a toaster, without anywhere to put the bread.
But it can do anything we can imagine: at least any computation we want to do.
The power of the computer is that it can execute the steps super super fast.
So we can execute billions of instructions in one second.
The program gives us a way to tell the computer what steps to take.
So there are many different languages for programming computers.
The language we are going to learn in this course is the language called Python, like the snake. It is also named after Monty Python.
The important thing about Python is that it gives us a nice high-level language that we can use to write programs.
And that means instead of our program running directly on the computer, the programs we write will be an input to the Python program which runs on the computer.
What Python is is called an interpreter. That means it runs our programs, it interprets them,
executes the programs that we wrote in Python language by running a program in a language into the computer can understand directly.
Entonces comencemos con la programación, este
es el núcleo de las ciencias de la computación.
La mayoría de las maquinas están
diseñadas para hacer solo una cosa.
Esta se supone que es una tostadora, es un
dibujo representativo más que uno exacto
y la tostadora, bueno, podemos hacer
más de una cosa con la tostadora
podemos poner diferentes cosas en ella.
Podemos tostar pan, muffins
quizás tiene algo que podemos usar
para cambiar su comportamiento.
Podemos cambiar las configuraciones para hacer
que funcione por más o menos tiempo.
Pero lo que puedo hacer es muy limitado, todo lo que hace es
solo una variación de una funcionalidad que ya ha sido diseñada.
El proceso básico de poner a tostar algo, calentar, y
volver a sacarlo hacia fuera.
Si queremos cambiar su comportamiento para hacer algo
completamente diferente, debemos cambiar físicamente la máquina.
Quizás podríamos desarmarla, y volver
a armarla de una manera diferente.
Si somos muy creativos podríamos hacer una bicicleta de una
tostadora. Ese en realidad sería un proyecto muy grande.
Entonces sin un programa, un computador seria
incluso menos útil que una tostadora.
Tú no puedes hacer nada sin un programa.
Un programa le dice a un computador que debe hacer.
Y el poder de un computador, a diferencia de una tostadora que
está diseñada solo para un par de cosas,
es que un computador puede hacer de todo.
Un computador es una maquina universal. La podemos
programar para que haga cualquier cómputo (o cálculo).
Cualquier cosa que imaginemos, solo debemos encontrar
la manera correcta de decirle a un programa que hacer.
Y lo que necesita un programa es solo una secuencia precisa de pasos.
El computador por sí mismo no sabe cómo hacer nada.
Solo conoce unas pocas instrucciones simples que puede ejecutar.
Y para que un programa haga algo útil debemos poner esas
instrucciones de manera que hagan lo que queremos.
Entonces podemos convertir un computador en un navegador web,
un servidor, en una máquina para jugar
o en una tostadora, sin ningún lugar donde poner el pan.
Puede hacer cualquier cosa que imaginemos, o al menos
cualquier cosa que seamos capaces de calcular.
El poder de un computador es que puede
ejecutar los pasos súper súper rápido.
Entonces podemos ejecutar miles de
millones de instrucciones en un segundo.
El programa nos da una forma de decirle
al computador que pasos seguir.
hay varios lenguajes para programar computadores.
El lenguaje que vamos a aprender en este curso es python,
llamada así por los Monty Python (ndt. grupo humorístico británico)
Lo importante de python es que nos da un lenguaje de alto nivel
que podemos utilizar para escribir programas.
En vez de escribir un programa directamente para el computador,
el programa que escribiremos sera una entrada al
programa python que si corre en el computador.
Lo que python llama un intérprete. Esto quiere decir que corre
nuestros programas, los interpreta, ejecuta el programa que
escribimos usando el lenguaje python
en un lenguaje entendible por la máquina directamente.
Donc, commençons avec la programmation qui est la base de la science de l'informatique.
La plupart des machines sont conçues pour faire juste une chose.
C'est censé être un grille-pain, ce dessin est davantage représentatif que précis.
Et avec un grille-pain, nous pouvons faire plus d'une chose.
Nous pouvons y mettre des choses différentes. Nous pouvons faire griller du pain, des muffins, peut-être y a-t-il des choses que nous pouvons utiliser pour changer son comportement.
Nous pouvons changer le réglage pour faire griller pour plus ou moins longtemps .
Mais ses capacités sont assez limitées, tout ce qu'il peut faire, c'est une variation de cette fonctionnalité de base pour laquelle il a été conçu.
Le processus de base est de mettre du pain à griller, le chauffer et de retirer la tartine.
Si nous voulons changer son comportement en raison de quelque chose de vraiment différent , nous aurions à modifier physiquement la machine .
Nous pourrions peut-être retirer les pièces, et les assembler d'une nouvelle façon .
Si nous étions vraiment créatifs, nous pourrions faire un vélo du grille-pain . Ce serait alors un projet relativement important.
Alors, sans programme, un ordinateur est encore moins utile qu'un grille-pain.
Vous ne pouvez rien faire sans un programme.
Le programme est ce qui indique à l'ordinateur quoi faire .
Et la puissance de l'ordinateur, à la différence d'un grille-pain qui est conçu uniquement pour faire des choses anodines, un ordinateur peut faire beaucoup de choses.
Un ordinateur est une machine universelle. Nous pouvons le programmer pour faire pratiquement n'importe quel calcul .
- Alors, tout ce que nous pouvons imaginer, tout ce que nous pouvons comprendre comment écrire un programme pour nous pouvons rendre l'ordinateur faire.
- Et qu'est-ce que le programme doit être est une séquence très précise des étapes .
- L'ordinateur en lui-même ne sait pas comment faire quelque chose . Il a quelques instructions simples qu'il peut exécuter .
- Et de faire un programme ne quelque chose d'utile nous avons besoin de mettre ces instructions et d'une manière qu'il fait ce que nous voulons .
- Ainsi, nous pouvons mettre l'ordinateur dans un navigateur web , sur un serveur , dans une machine jouant le jeu , dans un grille-pain , sans nulle part où mettre le pain .
- Mais il peut faire tout ce que nous pouvons imaginer et au moins tout calcul que nous voulons faire .
- La puissance de l'ordinateur est qu'il peut exécuter les étapes super super rapide .
- Alors, nous pouvons exécuter des milliards d'instructions par seconde .
- Le programme nous donne un moyen de dire à l'ordinateur des mesures à prendre .
- Donc, il ya beaucoup de différentes langues pour les ordinateurs de programmation .
- Nous allons apprendre le python de programme , comme son nom , il est nommé d'après le python monty .
- La chose importante à propos de python , c'est qu'il nous donne une belle langue de haut niveau que nous pouvons utiliser pour écrire des programmes .
Jadi mari kita mulai dengan pemrograman, dan pemrograman adalah inti ilmu komputer.
Kebanyakan mesin hanya dirancang untuk melakukan satu hal.
Ini seharusnya menjadi pemanggang roti, terlihat lebih seperti reprentasi gambar daripada yang sebenarnya.
Dan pemanggang roti, kita bisa melakukan lebih dari suatu hal dengan pemanggang roti.
Kita dapat menaruh beragam hal di dalamnya. Kita dapat memanggang roti, muffins, mungkin itu memiliki sesuatu yang bisa kita rubah sedikit perilakunya.
Kita dapat mengubah pengaturan untuk membuatnya memanggang lebih lama atau lebih pendek.
Tapi itu cukup terbatas dalam apa yang dapat dilakukan. Semua yang dapat dilakukan adalah variasi pada fungsi dasar ini bahwa itu dirancang untuk:
proses dasar dari menempatkan roti, memanasinya itu dan mendapatkan roti panggang sebagai hasilnya.
Jika kita ingin mengubah perilaku untuk melakukan sesuatu yang benar-benar berbeda, kita harus mengubah mesin secara fisik.
Kita mungkin bisa merombaknya, dan menempatkan bagian - bagiannya dengan cara baru.
Jika kita benar-benar kreatif kita bisa membuat sepeda dari pemanggang. Meskipun itu akan menjadi proyek yang cukup besar.
Jadi tanpa sebuah program komputer bahkan kurang berguna daripada pemanggang roti.
Kamu tidak dapat melakukan apa - apa tanpa program.
Program adalah apa yang memberitahu komputer apa yang harus dilakukan.
Dan kekuatan komputer tidak seperti pemanggang roti yang hanya dirancang untuk melakukan beberapa hal, komputer dapat melakukan berbagai macam hal.
Sebuah komputer adalah mesin universal. Kita bisa memprogramnya untuk melakukan perhitungan apapun.
Jadi apa pun yang dapat kita bayangkan, apa pun yang kita bisa mencari cara untuk menuliskan sebuah program, kita dapat membuat komputer melakukannya.
Dan apa yang program butuhkan adalah urutan langkah - langkah yang sangat tepat.
Komputer dengan sendirinya tidak tahu bagaimana melakukan apa - apa. Komputer memiliki petunjuk sederhana yang dapat ia jalankan.
Dan untuk membuat program melakukan sesuatu yang berguna kita perlu menempatkan instruksi tersebut bersama - sama dengan cara itu akan melakukan apa yang kita inginkan.
Jadi kita bisa mengubah komputer menjadi web browser, server, menjadi mesin permainan, pemanggang roti, tanpa tempat untuk meletakkan roti.
Tapi itu bisa melakukan apapun yang kita bisa bayangkan: setidaknya setiap perhitungan yang kita ingin lakukan.
Kehebatan komputer adalah bahwa ia dapat menjalankan langkah - langkah itu dengan super super cepat.
Jadi kita dapat menjalankan milyaran instruksi dalam satu detik.
Program memberi kita cara untuk memberitahu komputer apa langkah yang harus diambil.
Jadi ada banyak bahasa yang berbeda untuk pemrograman komputer.
Bahasa yang kita akan pelajari dalam kursus ini adalah bahasa yang disebut Python, seperti ular. Hal ini juga dinamai Monty Python.
Hal penting tentang Python adalah bahwa ia memberi kita bahasa tingkat tinggi yang bagus yang bisa kita gunakan untuk menulis program.
Dan itu berarti bukan program kami berjalan langsung di komputer melainkan program yang kita tulis akan menjadi masukan untuk program Python yang berjalan pada komputer.
Python disebut sebagai interpreter. Itu berarti ia menjalankan program kita,
menafsirkan mereka, mengeksekusi program yang kita tulis dalam bahasa Python
dengan menjalankan program dalam sebuah bahasa yang komputer dapat secara langsung mengertinya.
それではコンピュータサイエンスの核となる
プログラミングを始めましょう
ほとんどの機械は1つのことを行うために
設計されています
正確なものよりもさらに具象的な描画になっていますが
これはトースターです
トースターの機能は1つだけではありません
例えばパンやマフィンなど違うものをトーストできます
この動作を変えることができる機能もあるでしょう
トーストする時間を長くしたり
短くしたり設定を変えることができます
しかしできることは限られており
設計された基本的な機能を変化させるくらいです
基本的なプロセスはトーストを入れ
温度が上がってポンとトーストが出てくることです
何かとても異なることでこの動作を変えたい場合は
機械を物理的に改造しなければいけません
パーツを取り外し
別の方法でパーツを組み立てることができるでしょう
とても大きなプロジェクトになりますが
トースターから自転車を作ることも可能でしょう
コンピュータはプログラムがなければ
トースターよりも役に立たないでしょう
プログラムは
コンピュータが行うことを教えるものです
少数の機能しかないトースターと違い
コンピュータの強みは何でもできることです
コンピュータは万能な機械で
基本的な操作を何でもプログラムすることができます
ですからプログラムの書き方を把握できるものはすべて
コンピュータに行わせることができます
プログラムは非常に正確な
一連のステップであることが必要です
コンピュータ自体は何かを行う方法を知りません
実行できる簡単な命令がいくつかあるだけです
私たちが望むことをプログラムが行うために
命令をまとめる必要があります
コンピュータをWebブラウザ、サーバ、ゲーム機
パンを置く場所のない
トースターに変えることができます
想像できることはすべて
そして行いたいあらゆるコンピュータ操作が可能です
コンピュータの力によって
非常に高速でそのステップを実行でき
1秒で数十億の命令を実行することができます
プログラムによって
コンピュータがどのステップを行っているか分かります
コンピュータをプログラミングする
たくさんの言語があります
モンティ・パイソンにちなんで
つけられた名前のような
Pythonというプログラムを
私たちは学んでいきたいと思います
Pythonで重要なことはプログラムを書くために使える
優れた高レベルの命令があることです
コンピュータで直接実行するプログラムの代わりに
私たちの書いたプログラムが入力され
コンピュータで実行するPythonプログラムになります
Pythonはプログラムを実行するという意味の
インタプリタと呼ばれています
プログラムを解釈し
言語でプログラムをコンピュータに実行することで
Python言語で書いたプログラムを実行します
프로그래밍이 무었인지 알아볼까요? 프로그래밍은 computer science에서 핵심이예요
대부분의 기계들은 한가지 일을 하도록 설계되었어요.
토스트기가 그 예죠.
토스트 기계로 한가지 이상의 일을 할 수 가 있어요
토스트기계에 서로 다른걸 넣을 수 가 있죠.
빵을 굽거나 머핀을 굽거나 할 수 있죠.
조금더 오래 굽거나 짧게굽거나 셋팅을 설정할 수 있죠.
그런데 상당히 제한적이죠. 토스트기기가지고 할 수 있는 모든 것은
기본기능에서 조금만 변화를 주는거죠.
기본기능(토스트를 굽거나 데우거나 꺼내거나)
만약 우리가 전혀 다른 기능을 원하면 우린 물리적으로
기계를 변경시켜야 할거예요
부품들을 분해해서 새로 조립하는거처럼요
만약 우리가 창의적이면 우린 토스트기계로부터 자전거를
만들 수 있겠죠. 진짜 큰 프로젝트일거예요
컴퓨터에서 프로그램이 없다면 토스트기기보다 유용하지 못할거예요
컴퓨터에선 프로그램없이는 아무것도 할 수 없죠
프로그램은 컴퓨터가 해야할 것을 말해주는거예요
토스트기기와는(몇가지 일만 하도록 설계됨) 다르게 컴퓨터의
힘은 어떤것도 할 수 있다는거예요
컴퓨터는 여러가지 일을 할 수 있는 기계예요. 우린 컴퓨터를 가지고
어떤 연산을 하는 프로그램이든 작성할 수 있죠.
우리가 상상하는 어던 것이든, 어떻게 작성하는지만 알 수 있다면
우린 컴퓨터를 가지고 만들 수 있어요
프로그램에 필요한 것은 몇가지 단계예요.
컴퓨터 그 자체로는 어떻게 하는지 알 수가 없어요.
실행할 수 있는 몇가지 간단한 명령어가 있어요
프로그램을 유용하게 만들기 위해 우린 몇가지 명령어를 합쳐야해요
우린 컴퓨터에 웹브라우저, 서버, 게임 플레이어, 토스트기기에 넣을 수 있어요.
우리가 상상하는 어떤 것이든 할 수 있죠.
우리가 원하는 것을 하기 위한 연산을
컴퓨터의 힘은 정말 정말 바르게 명령을 실행한다는거예요
우린 1,000,000,000이상의 명령어를 1초내에 실행할 수 있어요.
프로그램은 어떤 단계로 실행할지 컴퓨터에게 알려주는거예요.
컴퓨터 프로그램에는 다양한 언어들이 있어요.
이 수업에서 우리가 배울 언어는 파이썬이예요
파이썬의 중요한 점은 하이레벨 언어라는 점이죠
하이레벨이라는건 우리가 프로그램을 컴퓨터에 직접적으로 작성하는게 아니라 컴퓨터에서 실행중인 파이썬 프로그램에 우리의 코드를 집어 넣는거예요.
파이썬 인터프리터라 불리는것의 의미는 우리가 작성한
파이썬 코드를 컴퓨터가 이해하게끔 변환해주는거예요.
Então iniciaremos com programação e programação é de fato o núcleo da Ciência da Computação.
A maioria das máquinas é projetada para realizar uma única tarefa.
Suponha que isso é uma torradeira... mais como um desenho representativo que um bastante fiel...
E uma torradeira... nós podemos fazer mais de uma coisa com uma torradeira.
Nós podemos inserir diversas coisas nela... Nós podemos torrar pão, torrar biscoitos e para algumas coisas nós podemos mudar sua ação um pouquinho...
Nós podemos girar um marcador para que ela torre mais ou menos.
Mas é bastante limitado o que isso pode realizar. Tudo o que ela pode realizar é uma variação da funcionalidade básica para a qual ela foi projetada:
o processo básico de inserir pão, o aquecer e aguardar a torrada ser ejetada.
Se você quiser modificar seu comportamento para fazer algo realmente diferente, nós teremos que alterar fisicamente a máquina.
Nós talvez possamos retirar algumas partes e as remontar de uma maneira diferente.
E se nós formos realmente criativos, nós poderíamos talvez fazer uma bicicleta de uma torradeira. Isso seria no entanto um projeto bastante extenso...
E então, sem um programa, um computador é ainda menos funcional que uma torradeira.
Você não pode fazer nada sem um programa.
O programa é o que diz ao computador o que ele deve fazer.
E o poder do computador é que, diferente da torradeira que foi desenhada para fazer apenas umas poucas coisas, ele pode fazer qualquer coisa...
Um computador é uma máquina universal. Nós podemos programá-lo para fazer de fato qualquer cálculo.
Então qualquer coisa que pudermos imaginar, qualquer coisa que nós podermos conceber de maneira a escrever um programa de computador, nós podemos fazer a máquina realizar.
E o que um programa necessita ser é uma sequência precisa de passos.
O computador por ele mesmo não sabe fazer nada. Ele tem algumas instruções muito simples que ele pode executar.
E para criar um programa para fazer algo útil, nós precisamos colocar estas instruções de tal maneira que ele realize o que nós queremos.
Então nós podemos transformar o computador num navegador Web, num servidor, numa máquina de videogame, numa torradeira, sem lugar algum para inserir o pão...
Mas ele pode fazer qualquer coisa que imaginemos: ao menos qualquer cálculo que queiramos.
O poder do computador é que ele pode executar os passos super, super rápido.
Então nós podemos executar bilhões de instruções em um segundo.
O programa nos dá uma maneira de dizer ao computador quais passos executar.
Então existem diversas linguagens para programar computadores.
A linguagem que iremos aprender neste curso chama-se Python, como a serpente... Ela foi assim nomeada por causa de Monty Python [NT: série de comédias inglesas]
O que é importante no Pyton é que ele nos provê de uma linguagem de alto nível que nós podemos usar para programar.
E isso significa que ao invés do nosso programa rodar diretamente no computador, o programa que escrevermos irá servir de entrada para o programa Python, este que irá rodar no computador!
O que o Python é é o que se chama de Interpretador. Isso significa que ele roda nossos programas, ele os interpreta, executa o programa que escrevemos na linguagem Python usando um programa na linguagem que nosso computador pode entender diretamente.
Então vamos começar com a programação que
é realmente o coração da Ciência da Computação.
Maioria das maquinas são projetadas
para fazer somente uma coisa
Isto erá supostamente para ser uma torradeira
mas é um desenho representacional que um acurado
uma torradeira, nos podemos fazer mais do que uma com um torradeira.
Nos podemos colocar diferentes coisas nela. Nos podemos colocar pão, nos podemos torrar muffins, talvez tem algumas coisas que podemos usar para alterar o seu comportamento um pouco
Podemos configura-la para o pão torrar por mais tempo ou menos
Mas é bastante limitada o que pode fazer. Tudo o que pode fazer
é uma variação nas funcionalidades básicas que foi projetada.:
o processo básico de colocar um pão, aquecer e colocar para fora.
se nos quisermos mudar seu comportamento para fazer algo bem diferente, precisaremos alterar a maquina fisicamente.
Talvez poderíamos retirar suas partes e juntá-las novamente em uma nova forma.
se realmente quisermos ser criativos poderíamos fazer uma bicicleta da torradeira. Que seria um projeto enorme, no entanto.
Então, sem um programa, um computador e menos util que uma torradeira.
Você não pode fazer nada sem um programa.
O programa é o que diz ao computador o que fazer.
é isso é o poder do computador, diferente de uma torradeira, que foi projetada para fazer somente alguma coisas, um computador pode fazer qualquer coisa
O computador é uma maquina universal. Podemos programa-la para fazer essencialmente qualquer computação.
Deci, să începem să programăm. Programarea este esența informaticii.
Majoritatea mașinilor sunt proiectate să facă un singur lucru.
Acesta se dorește a fi un prăjitor de pâine, mai mult un desen de reprezentare decât unul real.
Noi putem face mai mult decât un singur lucru cu un prăjitor de pâine.
Putem pune multe lucruri în el. Putem prăji pâine, brioșe. El poate chiar să conțină niște elemente utile pentru a-i schimba un pic comportamentul.
Noi putem modifica o setare pentru ca acesta să prăjească o perioadă mai scurtă sau mai lungă de timp.
Dar acțiunile acestuia sunt destul de limitate. Tot ce poate face constă în variații ale comportamentului de bază pentru care a fost proiectat:
procesul de bază de a pune pâinea prăjită în el, de a o încălzi și de a o sălta când este gata.
Dacă am vrea să îi schimbăm comportamentul să facă ceva cu totul diferit, ar trebui să alterăm mașina fizic.
Am putea să îl desfacem în componente și să îl asamblăm într-o manieră diferită.
Dacă suntem foarte creativi am putea chiar face o bicicletă dintr-un prăjitor de pâine. Însă aceasta ar presupune foarte multă muncă.
Deci, fără un program, un calculator este mai puțin folositor decât un prăjitor de pâine.
Nu poți face nimic fără un program.
Programul este cel care îi spune calculatorului ce să facă.
Calculatorul poate să facă orice, spre deosebire de prăjitorul de pâine, care este proiectat să facă foarte puține lucruri.
Calculatorul este o mașină universală. Îl putem programa să facă orice calcul.
Putem face un calculator să execute orice ne putem imagina atâta timp cât ne putem da seama cum să scriem un program pentru asta.
Un program constă dintr-o secvență exactă de pași.
Calculatorul nu știe să facă nimic de unul singur. El are câteva instrucțiuni simple pe care le poate executa.
Și, pentru ca un program să facă ceva util, trebuie să combinăm acele intrucțiuni într-o formă care asigură execuția a ceea ce ne dorim.
Deci, putem transforma un calculator într-un browser web, server, mașină pentru jocuri, prăjitor de pâine, dar fără locul unde se pune pâinea.
Dar calculatorul poate face orice ne putem imagina: cel puțin orice calcul.
Puterea calculatorului constă în faptul că acesta poate să execute pașii foarte foarte rapid.
Deci putem executa miliarde de instrucțiuni într-o singură secundă.
Un program ne dă posibilitatea de a-i spune calculatorului ce pași să execute.
Există diferite limbaje pentru a programa calculatoarele.
Limbajul pe care îl vom învăța în acest curs se numește Python, ca pe șarpe. De asemenea, este numit după Monty Python.
Cel mai importnat lucru despre Python este că ne oferă un limbaj drăguț, de nivel înalt, ce poate fi folosit pentru a scrie programe.
Asta înseamnă că, în loc ca programul nostru să execute direct pe calculator, programele scrise de noi vor fi date de intrare pentru programul Python, care va executa pe calculator.
Python este un interpretor. Asta înseamnă că el interpretează și execută programele scrise de noi în limbajul Python, executând un program într-o limbă pe care calculatorul o poate înțelege direct.
O halde programlamaya geçelim. Programlama
gerçekte bilgisayar biliminin temelidir.
Makinaların çoğu tek bir iş yapmak için
dizayn edilmiştir.
Şekilde gördüğünüz bir ekmek kızartma
makinası, görünüşüne takılmayın.
Bu makinayla belki birden fazla iş
yapabiliriz.
İçine değişik şeyler koyabiliriz. Bir kek
gibi.Belki yaptığı iş az da olsa değişir
Mesela kızartma süresini biraz az yada
fazla olarak değiştirebiliriz.
Fakat yine de yapabilecekleri sınırlıdır.
Yapacakları temel fonksiyonunun bir
varyasyonu olacaktır. Yani "materyali koy,
ısıt, kızart ve dışarı ver"
Asıl fonksiyonunu temelden değiştirmek istersek
makinayı fiziksel olarak değiştirmemiz gerekir.
Makinayı parçalarız ve yeni bir
halde bir araya getirebiliriz.
Gerçekten yaratıcı olabilirsek parçaları
ile bir bisiklet bile yapabiliriz. Tabi bu
çok büyük bir proje olur. Aynen bu şekilde
programsız bir bilgisayar
bir ekmek kızartma makinasından
daha faydasızdır. Programsız
hiç bir şey yapamazsınız. Bilgisayara ne
yapması gerektiğini söyleyen programdır ve
çok az şey yapabilen kızartma makinasının
aksine bilgisayar her şeyi yapabilir.
Bilgisayar genel bir makinadır ve onu tüm
hesaplamalarımızı yapmak için programlaya-
biliriz. Tasarlayabildiğimiz, programlama
yapıp kodunuz yazabileceğimiz herşeyi
bilgisayara yaptırabiliriz
Bilgisayarın ihtiyacı olan şey kesin
olarak tanımlanmış adımlar silsilesidir.
Bilgisayar kendiliğinden ne yapacağını bil
mez, anladığı bir kaç komut seti vardır.
Bir program yapmak için onları
istediğimiz işi yapacak şekilde kullanırız
Bir web tarayıcısı, sunucu, oyun konsolu
fiziksel olmayan bir kızartma makinası...
Bilgisayara hayal ettiğimiz herşeyi yaptı-
rabiliriz, en azından hesaplamaları.
Bilgisayar bu adımları süper hızlı
gerçekleştirebilir
ve saniyede milyarlarca komut yürütebilir.
Program bilgisayara istediğimiz adımları
yaptırmak için kullandığımız yoldur ve
programlama
için kullanılan bir çok dil vardır. Bu
kursta kullanacağımız dil Python dilidir.
İsmini bir yılanın isminden alan bu dil
kolay anlaşılan bir yüksek seviye dildir.
Yani programımız direk bilgisayarda çalış-
mayacak, Python programının üstünden
çalışacaktır. Buna interpreter denir.
Python dilinde yazdığımız programımızı
çalıştırır, yorumlar ve yürütür.
Почнемо з програмування,
бо це основа інформатики
більшість приладів виконують одну функцію
це - тостер: його наочна картинка
і... з тостером можна робити багато чого
Туди можна покласти хліб, кекси
є якісь кнопки для зміни режиму роботи
щоб робити тости довше, або швидше
але насправді його завдання тільки одне
з різними незначними варіаціями.
Один процес: поклали хліб,
нагріли - і маємо тост.
Якби ми захотіли кардинально
змінити його функції
то мусили б якось змінити і сам тостер.
Наприклад, можна розібрати тостер
і зібрати його по-іншому
якби в нас вистачило сили на амбітний проект,
то можна було б зробити ... велосипед.
Без програм комп'ютер - просто залізяччя
навіть тостер корисніший.
Програми кажуть комп'ютеру, що треба робити
А сила комп'ютера в тому, що
на відміну від тостера, який робить щось одне,
комп'ютер може робити ВСЕ.
Він універсальний, бо ми можемо
запрограмувати його для виконання
фактично будь-яких операцій.
Все, що тільки можна уявити і
написати для цього програму
можна зробити з комп'ютером.
Програма - це точна послідовність команд.
Сам комп'ютер не вміє нічого. Він має лише
кілька простих інструкцій, які може виконати.
Щоб зробити корисну програму
треба скласти ці інструкції так,
щоб вийшло саме те, що треба.
Комп'ютер легко перетворити в
інтернет-браузер, сервер, ігрову приставку
навіть в тостер ... :).
Але не буде куди покласти хліб.
Але він може робити фактично все, що
тільки можна уявити.
А сила комп'ютера в тому,
що він може зробити все неймовірно швидко:
мільярди операцій за секунду!
А програми дають нам можливість передати
наші інструкції комп'ютеру, щоб він знав, що робити.
Існує багато різних мов програмування
Мова, яку ми збираємось вивчити - це Python
Її назва перекладається як "пітон"
Важливо, що Python - програма, яка дає
прекрасну мову, на якій можна писати інші
програми. А це значить, що програма,
яку ми напишем, буде виконуватися не просто
в комп'ютері, а буде вхідним (input) файлом
для програми Python .
Python - це ніби перекладач, який перетворює
нашу програму з мови Python в мову,
на якій працює комп'ютер
让我们开始编程 编程是计算机科学的核心
大多数的机械都是设计成只能做一件事的
这是一个烤面包机 只是大概的画一下 并不准确
我们可以用一个烤面包机做好几件事
我们可以把许多东西放进去 可以烤面包、做松饼 或许我们可以稍稍改动一下它
我们可以使面包机烤的时间长些或短些
但是我们能做的事情还是有限制的 所有的变化都是基于最基础的设计意图:
把面包放进去 加热 然后等待面包从机器里蹦跶出来
如果我们想要面包机的行为变得不同 我们必须从物理结构上改变这个机器
我们或许可以取出部分零件 再把它们重新组装起来
如果我们特别有创造力 说不定可以用烤面包机做个自行车 特别酷炫 但肯定挺复杂
所以 如果没有了程序 电脑可能比烤面包机还要没用
没有了程序 电脑什么事情都做不了
是程序告诉了电脑去做什么
电脑的厉害之处是 不像面包机那样只能做一些事 电脑可以做任何事
一台电脑是一台通用机 通过编程 我们可以让它做几乎任何计算
任何我们能想到的事 只要能写出程序 我们都可以让一台电脑去做
而这个程序就是一系列精确的步骤
电脑本身不会做任何事情 它只能执行一些简单的指令
为了让程序做一些有用的东西 我们需要把那些指令以特殊的方式结合在一起
我们可以把电脑变成网页浏览器、服务器、游戏机、面包机(没有地方放面包)
它能做我们想到的任何东西 至少是任何的运算
电脑的长处是它可以运行的非常非常快速
这样我们就可以在一秒钟执行上亿个指令
程序告诉电脑去做什么步骤
所以有许多不同的编程语言
在这个课程里我们学习的语言叫做 Python 就像条蛇的名字 它是以 Monty Python 命名的
Python 的好处是它是一个高级的语言
这意味着我们的程序会被编成一个 Python 程序之后在电脑运行 而不是直接在电脑运行
Python 被称为一个解释程序 这说明它会运行我们的程序 解释它们
用电脑懂的语言执行我们用 Python 语言写的程序