tag:blogger.com,1999:blog-26792871352096667212024-02-19T22:27:30.272+05:30Let's LearnProgramming from Code Studio, Arduino, Python, Scratch, GIMP etcSanjay Rajurehttp://www.blogger.com/profile/11542442972509970207noreply@blogger.comBlogger181125tag:blogger.com,1999:blog-2679287135209666721.post-52501560717956103742020-02-10T18:19:00.003+05:302020-02-10T21:49:08.306+05:30Creating Games in Scratch for ICSE Class 6<h2 style="text-align: center;">
<span style="color: #674ea7;">An Introduction to Creating Games in Scratch </span></h2>
<h2 style="text-align: center;">
<span style="color: #674ea7;">for ICSE Class 6</span></h2>
<br />
Hello friends, I hope you have already read the <a href="https://www.comprolive.com/2020/02/an-introduction-to-scratch-programming.html" target="_blank">previous post</a> on An Introduction to Scratch programming for ICSE Class 5. We will not and need not repeat the things that you learnt in the previous lesson. So we will build upon what we already learnt in the previous lesson.<br />
<br />
Scratch is a good software to make Animations, Stories, Games, Music and Drawing and so on. We will learn briefly the tools available in Scratch to do all these things. We will also need to stick to the scope of the Syllabus that ICSE board has prescribed for your class, so we can not go overboard. We will stick to just enough information that can be useful in your school exams. I hope things are clear to you by now.<br />
<br />
<h2>
<span style="color: #3d85c6;">Components of the Scratch Editor </span></h2>
<div>
I will not repeat this section as we have seen it in pretty much detail in the previous lesson. If you like you can read it <a href="https://www.comprolive.com/2020/02/an-introduction-to-scratch-programming.html" target="_blank">from this link.</a></div>
<div>
<br /></div>
<h2>
<span style="color: #3d85c6;">Adding Backdrop on the Stage</span></h2>
<div>
<span style="color: #3d85c6;"><br /></span></div>
<div>
The stage is the area in Scratch where we see all the action taking place. If you have seen a stage of a Theater, you can compare this to it. We can add a backdrop to this stage. It is like adding a wallpaper to your desktop or to your smartphone. A backdrop is an image that you can choose from the Scratch library.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia3GfgPzU6Ft8KkZw-0AEhYU_HCdQSPUIKjNVTBcjwhu6j6ip2Ep5T1qxQG84wkQjrZSWfjnvsQjMgpH6tRDWAshjNPP9eiN5BLdftbccRpWy1Dl2-4kbU3HXepMjYW6xsrUNMtbdbbpUk/s1600/stage-info.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="284" data-original-width="268" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia3GfgPzU6Ft8KkZw-0AEhYU_HCdQSPUIKjNVTBcjwhu6j6ip2Ep5T1qxQG84wkQjrZSWfjnvsQjMgpH6tRDWAshjNPP9eiN5BLdftbccRpWy1Dl2-4kbU3HXepMjYW6xsrUNMtbdbbpUk/s1600/stage-info.png" /></a></div>
You will see this icon as seen in the image, in the bottom-right corner of your Scratch editor. Click on it and a menu pops up. Clicking on the magnifying glass will take you to the backdrop selection page or the backdrop library. There are several backdrops to choose from. Choose the one suitable to your project and it will appear in the stage area in the Scratch Editor. </div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_z12gPHnhmuye19l-qIKDnzD7JN1QJFOplVflXQteXqdmfMfDeency3dJI8Wa-V6OLu2uwVq0mKu_uAf-uvzN5CTTK3hEJCn4XPz_ZEpyAgct3vUGWt0E2y1glaSYoSKzSHw5eXEO-VFO/s1600/backdrop+library.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="450" data-original-width="800" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_z12gPHnhmuye19l-qIKDnzD7JN1QJFOplVflXQteXqdmfMfDeency3dJI8Wa-V6OLu2uwVq0mKu_uAf-uvzN5CTTK3hEJCn4XPz_ZEpyAgct3vUGWt0E2y1glaSYoSKzSHw5eXEO-VFO/s640/backdrop+library.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The backdrop library</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmxcifNObh15PddNx6wtZIPybWQwvU6HEL3LWg8mlnv-UtsK8fLp0JRD7RA5GiGgc4BKEEQBNkTZXpJEjeT0CMLBCFQM7gWW8db-MkmQizvjymYuvU5FDv0Sy1l1iDh9Q4ALxmbNYxQREj/s1600/backdrop+in+the+stage.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="487" data-original-width="559" height="278" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmxcifNObh15PddNx6wtZIPybWQwvU6HEL3LWg8mlnv-UtsK8fLp0JRD7RA5GiGgc4BKEEQBNkTZXpJEjeT0CMLBCFQM7gWW8db-MkmQizvjymYuvU5FDv0Sy1l1iDh9Q4ALxmbNYxQREj/s320/backdrop+in+the+stage.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Selected backdrop appears on stage</td></tr>
</tbody></table>
<div>
You can choose one or more backdrops for your project. You can change them with a code during the course of the program. It means you can pre select all the backdrops that you want to see in your project. They will all appear inside the Backdrops panel. </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGkQHYOiwKJgjBSrISjrqQVuoSRsvsh3RIuSecWAsv3polCNcQ9C6L9d8loOXcPLMhqK-McEFkGbcW6VN4lRA3hIRdyiTpUi5SfPms0l29vmfaomdtB94N1UEGTOi5USbSAhJvl0KTwjxY/s1600/multiple+backdrops.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="565" data-original-width="780" height="462" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGkQHYOiwKJgjBSrISjrqQVuoSRsvsh3RIuSecWAsv3polCNcQ9C6L9d8loOXcPLMhqK-McEFkGbcW6VN4lRA3hIRdyiTpUi5SfPms0l29vmfaomdtB94N1UEGTOi5USbSAhJvl0KTwjxY/s640/multiple+backdrops.jpg" width="640" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Here is a script that will use multiple backdrops that you have added in your project. It will change the current backdrop with the next one whenever you press the spacebar. </div>
<div>
<br /></div>
<div>
You need to first select the Stage panel in the bottom right, after that select the backdrop tab. Then add this code in the script area. </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbTDkCysXOSbDfW8KvMpOsgAMHyAbZWsbhRv5v2LecAe5piKxKtZZ2ErTv9gtvcbixu17UZCmq59c8mpQyGzMpy5rburzRkpyGQSxjkTVk8x9a-3IoRSZTDKlq-IRJ33Ix9YGOn06f_jTq/s1600/code2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="314" data-original-width="307" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbTDkCysXOSbDfW8KvMpOsgAMHyAbZWsbhRv5v2LecAe5piKxKtZZ2ErTv9gtvcbixu17UZCmq59c8mpQyGzMpy5rburzRkpyGQSxjkTVk8x9a-3IoRSZTDKlq-IRJ33Ix9YGOn06f_jTq/s1600/code2.jpg" /></a></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<h2 style="clear: both; text-align: left;">
<span style="color: #3d85c6;">Changing the size of the sprite </span></h2>
<div>
In the previous version, there were icons on the toolbar to enlarge or shrink an image, the sprite. But now it has been deprecated in Scratch. You can specify the size of the sprite in the code itself, in terms of percentage. This is an example of a script that will make the sprite smaller by 10 percent whenever you will press the spacebar. Look at the first block after the Green Flag clicked block. It is where you can set the initial size of your sprite. </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhHUy8yGmsbRjklVBE_jlngszJIu8PGomw-5_YyGhZ8nmh9lb26Jja9z5rCCH8pV4imlAoFHHQMuLzHAxR-Wh-PYNJ31LQ0ofCJ3EFg93Kd96U7iS2akQwfDE178JyU8m6xZ78GLyk1TS5/s1600/code3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="310" data-original-width="276" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhHUy8yGmsbRjklVBE_jlngszJIu8PGomw-5_YyGhZ8nmh9lb26Jja9z5rCCH8pV4imlAoFHHQMuLzHAxR-Wh-PYNJ31LQ0ofCJ3EFg93Kd96U7iS2akQwfDE178JyU8m6xZ78GLyk1TS5/s1600/code3.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h2 style="text-align: left;">
<span style="color: #3d85c6;">Customize Sprite</span></h2>
<div>
If you have added a few sprites in the scratch editor before, you should notice in the Costumes tab more than one images of the same sprite. These images are depicted in different action. An image of a sprite is called a costume. When you display these images one after the other rapidly, they appear as if the sprite is making movement. </div>
<div>
<br /></div>
<div>
A good thing about these costumes is that you can create a new costume. You can select any of the costume and right click on it, and select duplicate. It will add another of the same image but with a different name. You can now edit this image. </div>
<div>
You can flip the image horizontally or vertically if needed and use it as a new costume.</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrJomVnSFyG1m3qFH2TbRTAE9j3JGTmmyVkYtGLadGRX6NzOkWRUGX3U3DSQNGjHfmN7VxZASIz2wXnmgco262nYZYunXUhxyLK5jbWmmGc_3IFELUzRxQTA8ssPRIpdX9gsR-8zSTJE07/s1600/customizing+costumes.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="664" data-original-width="799" height="529" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrJomVnSFyG1m3qFH2TbRTAE9j3JGTmmyVkYtGLadGRX6NzOkWRUGX3U3DSQNGjHfmN7VxZASIz2wXnmgco262nYZYunXUhxyLK5jbWmmGc_3IFELUzRxQTA8ssPRIpdX9gsR-8zSTJE07/s640/customizing+costumes.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">customizing costumes</td></tr>
</tbody></table>
<div>
<br /></div>
<div>
<br /></div>
<div>
If you change the image from Bitmap to vector mode and then ungroup it, you will see different nodes of that image. There are handles to stretch or rotate the nodes, which will help to create an image with a different position. After editing is over, group them and convert the image back to bitmap mode. </div>
<div>
<br /></div>
<div>
This is how you can customize a sprite.<br />
<br />
<h2>
<span style="color: #3d85c6;">Customize Backdrop </span></h2>
</div>
<div>
We have seen how we can add more than one backdrop from the library and can bring them on the stage using coding. We can also use the paint editor in Scratch. First select the Stage pane in the bottom right, then click on the Backdrops tab on the top right corner of the screen. You will see a blank backdrop. You can change this backdrop to bitmap mode, and fill in colors of your choice. You can also add Text and some shapes available in the paint editor. This way you can create your own customized backdrop. You can even give it a name of your choice. </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXNfWqI_NUF3QvR4MG3zrr5Ik8a1EAjDIlImvRPRFs2LLkavUgE40wEIKYzaZjWQeOvGHM7PdL1CW5PAnrxv-kvVfHDbTiNAREFSlrHIWKJRX29mHxINNinbiE7rIzLzMoUUUFwjlj0mRj/s1600/customized+backdrop.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="768" data-original-width="1366" height="358" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXNfWqI_NUF3QvR4MG3zrr5Ik8a1EAjDIlImvRPRFs2LLkavUgE40wEIKYzaZjWQeOvGHM7PdL1CW5PAnrxv-kvVfHDbTiNAREFSlrHIWKJRX29mHxINNinbiE7rIzLzMoUUUFwjlj0mRj/s640/customized+backdrop.jpg" width="640" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<h2>
<span style="color: #3d85c6;">Multiple Sprites on the stage</span></h2>
</div>
<div>
You can use the Sprite info pane below the Stage area, and click on the "Choose a sprite" icon and add one or more sprites in the stage area. You can add as many sprites on the stage as you can accommodate. But you will have to code them all separately. You need to first select the sprite's thumbnail from the info pane and then add code in the code or script area. </div>
<div>
<br /></div>
<div>
Remember to use the hat block from the Events category - "When Green Flag Clicked" as your first block in your code.</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwYddIHunws1MZGHvtwFTTxNfwow48E6HN5FLQs4fnCQyf96Nm8580AYWC9G2_nOefGA89ZkY4EsCy4iwrUOg1EDWD5K1GmIYZ0bE6X1sqYcDmwKNQRGfpahKfwkMaKYIle58oPncaURQ2/s1600/many+sprites.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="661" data-original-width="522" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwYddIHunws1MZGHvtwFTTxNfwow48E6HN5FLQs4fnCQyf96Nm8580AYWC9G2_nOefGA89ZkY4EsCy4iwrUOg1EDWD5K1GmIYZ0bE6X1sqYcDmwKNQRGfpahKfwkMaKYIle58oPncaURQ2/s320/many+sprites.jpg" width="252" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">multiple sprites on the stage</td></tr>
</tbody></table>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<h2>
<span style="color: #3d85c6;">Block Categories</span></h2>
</div>
<div>
<br /></div>
<div>
We have already seen the Motion, Looks, Sound and Control block categories in the previous lesson. Today we will learn about the Events category.</div>
<div>
<br /></div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMaUtshLbY42sgjpN7DmohgvzsWpPQiSG2jIM4YURwClIxpqs0V7XUiQuHtGfr33keRUrtKtd1YsvHjF45bbHM5Gf3-vl7XKU7bFxj7_LQnpqfwIuvAX41PNkp_bwJwF6SD-kSh4nKg2oT/s1600/events.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="568" data-original-width="340" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMaUtshLbY42sgjpN7DmohgvzsWpPQiSG2jIM4YURwClIxpqs0V7XUiQuHtGfr33keRUrtKtd1YsvHjF45bbHM5Gf3-vl7XKU7bFxj7_LQnpqfwIuvAX41PNkp_bwJwF6SD-kSh4nKg2oT/s640/events.jpg" width="382" /></a></div>
It has six Hat blocks, and two stack blocks. Hat blocks are the type of blocks that are placed at the top of the Script. A script begins with a Hat block. "When green flag clicked" is the first block that you will add into your project.<br />
<br />
There is another important block called "When space key pressed". If you click on the space words in this block you will see a long menu listing all the keys on your keyboard. You can use this block to add interaction into your scratch project. When you press one of the keys, then add some action to be performed.<br />
<br />
The third important block is the "When this sprite clicked". If you add this block to a sprite and add some action in the script, then that code will run when you click that sprite while the scratch project is running. This is very much useful in creating interactive animations, stories and games. </div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<h2>
<span style="color: #3d85c6;"> Sensing </span></h2>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVKGKieH6kYvx9KjQhOI4soCVgeUa88BKpsP5QysWop0K-ro0EzmSVHlFjG1eV5LA0Xjp4OuF0VMgD0l8uoD4BKBksXUagb2ZydFudKGn2d0UNmuVtN_B_3KbQD3WYLFEqtC89JrizQaOK/s1600/sensing.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="677" data-original-width="317" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVKGKieH6kYvx9KjQhOI4soCVgeUa88BKpsP5QysWop0K-ro0EzmSVHlFjG1eV5LA0Xjp4OuF0VMgD0l8uoD4BKBksXUagb2ZydFudKGn2d0UNmuVtN_B_3KbQD3WYLFEqtC89JrizQaOK/s640/sensing.jpg" width="299" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Sensing blocks are the light blue colored blocks. They are mostly reporter blocks. It means whenever they are used, they report some information into the script. The hexagonal shape of these blocks fits into the golden colored Control blocks. That is where they are used. You can get/sense information such as if one sprite is touching another one, if mouse pointer is touching a sprite, if one color is touching another color, if one sprite is closer to another sprite or not, if a certain key is pressed or not, what are the x and Y co-ordinates of a sprite in the stage. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
You can sense all this information and then use this information to create games in Scratch. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<h2 style="clear: both; text-align: left;">
<span style="color: #3d85c6;">Operators </span></h2>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_yokanxmcxO5u5uzH_KJZB1tVWVwM4_oLd7ik8TxikS_qU61rqUlljvKp9rrduqJZZkkLhIMiAPyHwHXJvUx6QOZ2PEcAxoiQxUG06idduAFk9l132cwCS8ps4KOF8cMCefok8uJmW5c4/s1600/operators.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="651" data-original-width="239" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_yokanxmcxO5u5uzH_KJZB1tVWVwM4_oLd7ik8TxikS_qU61rqUlljvKp9rrduqJZZkkLhIMiAPyHwHXJvUx6QOZ2PEcAxoiQxUG06idduAFk9l132cwCS8ps4KOF8cMCefok8uJmW5c4/s640/operators.jpg" width="234" /></a></div>
<div>
<span style="color: #3d85c6;"><br /></span></div>
<div>
Operators are green colored blocks. They can be used to make mathematical calculations as well as comparison of two values. You can even use sensing blocks inside the operators. There are comparison operators, boolean operators as well as text Strings. These are necessary for implementing your game logic. </div>
<div>
<span style="color: #3d85c6;"><br /></span></div>
<h2>
<span style="color: #3d85c6;">Variables</span></h2>
<div>
<span style="color: #3d85c6;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsBXIxRRX7c9chAVkOKIo25dDUGFSX6BZT3Ul6IDdpHp7m8Xm8zWpRADaR_dXpvePnEHBJTFEj7BjTC317LRiVK8AoOLIY-8Yx4Qpc_mTH-DL76qtw3moHCSWCo08WptVGpvexrXaqWRin/s1600/variables.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="346" data-original-width="277" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsBXIxRRX7c9chAVkOKIo25dDUGFSX6BZT3Ul6IDdpHp7m8Xm8zWpRADaR_dXpvePnEHBJTFEj7BjTC317LRiVK8AoOLIY-8Yx4Qpc_mTH-DL76qtw3moHCSWCo08WptVGpvexrXaqWRin/s320/variables.jpg" width="256" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Variables are the Golden colored blocks. They are used to create a counter or for counting number of events as they take place in your scratch project or game. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
There is also another type called a List, just below the Variable blocks. It allows you to create a number of variables as a single list. I haven't yet used it. But I mentioned it so that it does not go unnoticed. </div>
<h2 style="clear: both; text-align: left;">
<br /><span style="color: #3d85c6;">My Blocks</span></h2>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO5IOOhYgDExKG2wS-d3LXcwzoaFNTqauxjIl8IknZMxOrrUcoGvvJNSE4LI1RcPeIb4zATQcthuVlt0O1PJyK_eTg4Lo4KgaKqIF83cYuMu4tlBv6BPEhZK-FQCIU2TmkFdujtaIRskjh/s1600/make+a+block.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="565" data-original-width="747" height="242" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO5IOOhYgDExKG2wS-d3LXcwzoaFNTqauxjIl8IknZMxOrrUcoGvvJNSE4LI1RcPeIb4zATQcthuVlt0O1PJyK_eTg4Lo4KgaKqIF83cYuMu4tlBv6BPEhZK-FQCIU2TmkFdujtaIRskjh/s320/make+a+block.jpg" width="320" /></a></div>
<div>
<br /></div>
<div>
My blocks are pink colored blocks. It is a custom block creation tool. If you need to use a code routine in your project more than once, then instead of adding so many code blocks, you can create a single block using the My blocks dialog box. This will help you to reduce the number of code blocks appearing in the script area. Very useful when your project starts growing bigger.<br />
<br />
<h2>
<span style="color: #3d85c6;">Control Blocks</span></h2>
</div>
<div>
These are the Golden colored blocks, which have all the Loops in it. These are the blocks that include other blocks inside. </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoIq-cle75sRBQuffNTXPQwEIXv9Ig-A-ybEKrrSyoegstDapOTSum0JPLEZzl8oxwLBtmNReQfMtmwSsKScqaXHi_9Uryzsn_fTas7PswrFtBogCFdb70poxLslRbq1PHddfGXjw2Y2kq/s1600/repeat.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="127" data-original-width="151" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoIq-cle75sRBQuffNTXPQwEIXv9Ig-A-ybEKrrSyoegstDapOTSum0JPLEZzl8oxwLBtmNReQfMtmwSsKScqaXHi_9Uryzsn_fTas7PswrFtBogCFdb70poxLslRbq1PHddfGXjw2Y2kq/s1600/repeat.jpg" /></a></div>
<div>
Repeat - This block can be added just below any other stack block, or directly after the Beginner Hat block. The default number is 10. You can change this number to anything you want. You can then add other code blocks inside this block. It will keep on growing as you add more blocks in it. It will repeat the code inside it for the number of times written in the circle.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEir-WZV1FUEB1VRWztQpDjIgDxmdBMJlVmJqYHajLnQUOqCj8hErm24EgPXjI5Y2rtDGCo_oVkx-Iz9BRrYASuMuBal4Gl5-tvK9ql57he2taroJEHj6IMRsU-5vg4PfzTuEJanOCkiMP2K/s1600/forever.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="123" data-original-width="148" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEir-WZV1FUEB1VRWztQpDjIgDxmdBMJlVmJqYHajLnQUOqCj8hErm24EgPXjI5Y2rtDGCo_oVkx-Iz9BRrYASuMuBal4Gl5-tvK9ql57he2taroJEHj6IMRsU-5vg4PfzTuEJanOCkiMP2K/s1600/forever.jpg" /></a></div>
<div>
Forever - You can add any code in this block, and it will keep repeating till you press the Red stop button or Stop all the Script using the Stop block. </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKtAij4X3JZvCJofB29FRgmoPhWo31l8gUnEIN7clYXOyWcAGthibOr0o2d_9fEOJhqfCP-JtbVphcsRMfn6F1ZHyZW3o3OrqOqBX-YpGpLc3HYEM456H3L5D552JpOBYK1a3TjvhRLA7l/s1600/if-then.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="122" data-original-width="165" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKtAij4X3JZvCJofB29FRgmoPhWo31l8gUnEIN7clYXOyWcAGthibOr0o2d_9fEOJhqfCP-JtbVphcsRMfn6F1ZHyZW3o3OrqOqBX-YpGpLc3HYEM456H3L5D552JpOBYK1a3TjvhRLA7l/s1600/if-then.jpg" /></a></div>
<div>
If - Then : Is called a Conditional statement in programming terms. You can add a Blue colored Sensing block between the slot of If - Then. That is the condition, if fulfilled, then the code that you add inside this block will execute. Very useful in Game creation. </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy6qnS6OmU6QVyOk8C-f1UZZPnee0sKPZu_Gc9giERRpWa9kSsTs2oWBqhH5xZbfBraubnhTbpKcz6yMD1Lx8AqeYZaWunVN_bC2epanRDcWaCsUR7Hz5dwClUiZyekbNXvj6VlNLx_LxJ/s1600/if-then-else.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="160" data-original-width="166" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy6qnS6OmU6QVyOk8C-f1UZZPnee0sKPZu_Gc9giERRpWa9kSsTs2oWBqhH5xZbfBraubnhTbpKcz6yMD1Lx8AqeYZaWunVN_bC2epanRDcWaCsUR7Hz5dwClUiZyekbNXvj6VlNLx_LxJ/s1600/if-then-else.jpg" /></a></div>
<div>
If -Then -Else : You can have two set of blocks that will run. One set will run if the condition is fulfilled, the other set will run if it is not fulfilled. </div>
<div>
<br /></div>
<div>
There several other control blocks that you will find in the Scratch 3 Editor. </div>
<div>
<br /></div>
<div>
We will watch how these code blocks function in the video tutorials. </div>
<h3>
<span style="color: #6aa84f;">Tutorial 4</span></h3>
<div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/oTCP_HtJL7A/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/oTCP_HtJL7A?feature=player_embedded" width="320"></iframe></div>
<div>
<span style="color: #6aa84f;"><br /></span></div>
<h3>
<span style="color: #6aa84f;">Tutorial 5</span></h3>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/u5WCRNN6zpg/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/u5WCRNN6zpg?feature=player_embedded" width="320"></iframe></div>
<div>
<span style="color: #6aa84f;"><br /></span></div>
<h3>
<span style="color: #6aa84f;">Tutorial 6</span></h3>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/jWcuYAZpL20/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/jWcuYAZpL20?feature=player_embedded" width="320"></iframe></div>
<div>
<br /></div>
<br />
<h3>
<span style="color: #6aa84f;">Tutorial 7</span></h3>
</div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/fF6322x0YiM/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/fF6322x0YiM?feature=player_embedded" width="320"></iframe></div>
<div>
<span style="color: #6aa84f;"><br /></span></div>
Sanjay Rajurehttp://www.blogger.com/profile/11542442972509970207noreply@blogger.comtag:blogger.com,1999:blog-2679287135209666721.post-67657475139222396582020-02-08T19:12:00.004+05:302020-02-10T21:43:22.567+05:30Introduction to Scratch Programming for ICSE Class 5<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<h2>
<span style="color: #93c47d;">ICSE Class 5 Computer Studies</span></h2>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
This lesson will give students a brief introduction to Scratch programming. I am using Scratch3 Desktop software on Windows computer. The lesson is created according to ICSE syllabus for Class 5th.</div>
<br />
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b>Introduction to Scratch Software</b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
Scratch is a block based visual programming language. Blocks are the puzzle piece shapes that are used to code in Scratch. The current version of this software is Scratch 3. Scratch has an online editor on their website, which can be run directly in the browser or you can download and install the editor on your computer and run it from there.<br />
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b>Open the Scratch</b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg14XHEA_q0lxdV-snpOfNW6H41AakLjh1iR0XAQuDYe0gotDj9VeNbhOgwn4BWOEYbSCFI4sUM8kbc2y245PAwSqhv1RVZefRQ-2j2jt4xBeWGhBjAafsEnwuJ4e3mDHbXn9Dm1V_cY_wi/s1600/desktop-icon.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="123" data-original-width="107" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg14XHEA_q0lxdV-snpOfNW6H41AakLjh1iR0XAQuDYe0gotDj9VeNbhOgwn4BWOEYbSCFI4sUM8kbc2y245PAwSqhv1RVZefRQ-2j2jt4xBeWGhBjAafsEnwuJ4e3mDHbXn9Dm1V_cY_wi/s1600/desktop-icon.png" /></a></div>
If you have installed Scratch on your computer, you will see an icon of Scratch on the Desktop. Double click on it to start the Scratch Editor.<br />
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx0jN9E20jKs2mRbYfILBT-MaJcfttqdpSuj0QXawO9KWWdp5PhDizEj8UazPUdMd0-fbJqBVnUN8QxQffT4K-YDdF9zD_Dzyeebsxgxx-0QS2-u9XnSd4l7NRb7_ALpF6c-53W63Uk0nH/s1600/scratch-screen.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="768" data-original-width="1366" height="179" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx0jN9E20jKs2mRbYfILBT-MaJcfttqdpSuj0QXawO9KWWdp5PhDizEj8UazPUdMd0-fbJqBVnUN8QxQffT4K-YDdF9zD_Dzyeebsxgxx-0QS2-u9XnSd4l7NRb7_ALpF6c-53W63Uk0nH/s320/scratch-screen.png" width="320" /></a></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<br />
<br />
As you can see in the above image. The Scratch Screen is divided into several sections. The leftmost area is called “Block Palette”. It contains color-coded block categories. When you click on one of these colored dots, the blocks in that category appear in the right column.<br />
The middle portion is where all your code will reside. This is the area for creating scripts for you.<br />
The upper-right area is called the stage area. It will house all the sprites in your project, And this is where all the action of your project can be previewed. Below the stage there is sprite-info pane. You will see smaller images of the sprites that you add in the stage area.<br />
<br />
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b>Components of the Scratch 3 Editor</b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b>Stage and Sprite</b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfu7w1VVmk-V6Q91g_lQl754ftsDT-HwZn4ls4MU7jZL8iHS4XSy5mY5KxCumDGkDud0A1W2ZN9b2njW-K1Q586VoJOtNTte5sad_CnsPNCduQSpN_XMtRPJQSIMwl6WgDIHW8MSkNujYu/s1600/stage.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="400" data-original-width="535" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfu7w1VVmk-V6Q91g_lQl754ftsDT-HwZn4ls4MU7jZL8iHS4XSy5mY5KxCumDGkDud0A1W2ZN9b2njW-K1Q586VoJOtNTte5sad_CnsPNCduQSpN_XMtRPJQSIMwl6WgDIHW8MSkNujYu/s320/stage.png" width="320" /></a></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
The rectangular area at the right side of the Scratch Editor is called the Stage. This is where all your sprites ( cartoon images) appear. There is always a cat present when you open your Scratch. The cat is a sprite. And it will appear in the area that is called the Stage.<br />
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: black;"><span style="font-size: 14pt;"><br /></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b>Sprite info pane</b></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisbodQMx1hnTJjRi_sXMbIbBOUyrlPD1Ofxs80q_c1MXT0T63s4rT24iZ6mJBS_NMdr6_5Ojapew5nPg-SHWs14nFdTQEOGrn8TEvfiWLeWk047j-okieaI7bsQj5O83cc05E8wS1z4Vqp/s1600/sprite-info-pane.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="252" data-original-width="449" height="179" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisbodQMx1hnTJjRi_sXMbIbBOUyrlPD1Ofxs80q_c1MXT0T63s4rT24iZ6mJBS_NMdr6_5Ojapew5nPg-SHWs14nFdTQEOGrn8TEvfiWLeWk047j-okieaI7bsQj5O83cc05E8wS1z4Vqp/s320/sprite-info-pane.png" width="320" /></a></div>
<br />
This is the area below the stage. This is where you will find smaller images of the sprites you have added in the stage area.<br />
<br />
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b>Blocks</b></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEQIkd1ZmFMUYa__qdfLkL1XAkJQBpdR40EUHwowTArrnJJ2sfxj2KbmEVCoAbYZCjfTUwNO-Ox_iNCjD31qNhQhEsQ14O2aCWqr8rwOckkgId2pmXxSH2V1GA7oG7_aLN35-uBgCt3GrO/s1600/blocks-categories.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="440" data-original-width="73" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEQIkd1ZmFMUYa__qdfLkL1XAkJQBpdR40EUHwowTArrnJJ2sfxj2KbmEVCoAbYZCjfTUwNO-Ox_iNCjD31qNhQhEsQ14O2aCWqr8rwOckkgId2pmXxSH2V1GA7oG7_aLN35-uBgCt3GrO/s320/blocks-categories.png" width="53" /></a></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
Blocks are the puzzle piece shapes that are used to create code in Scratch. The blocks connect to each other vertically like a Jigsaw puzzle.<br />
There are different shapes of these blocks. They are called Hat blocks, stack blocks, reporter blocks, Cap blocks etc<br />
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVYum1ZLDv99h-RmTmhPibQ7WrnhP5VxAJic6fSv1iAN7G_riya20X3eLE0f9m_-uZ64u3qhUFAvxfj5o0T-Tedag2ui-u2kfxDZUFImqK3BbGXIvlvwz_6dN8a6KZ2He_B2yxcZV3wdmS/s1600/blocks.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="189" data-original-width="198" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVYum1ZLDv99h-RmTmhPibQ7WrnhP5VxAJic6fSv1iAN7G_riya20X3eLE0f9m_-uZ64u3qhUFAvxfj5o0T-Tedag2ui-u2kfxDZUFImqK3BbGXIvlvwz_6dN8a6KZ2He_B2yxcZV3wdmS/s1600/blocks.png" /></a>The blocks are arranged in color-coded categories that appear at the left most column in form of colored dots. When you click on one of these categories, the block in that category are displayed in the next column. We will learn some of the categories like Motion, Looks, Control and Sound in this lesson.</div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj83XB7H55AJHaKVQpEePiEdBrypMxnNZ_b_dFUT0GiaJmkSL5Y2Z5TGGelmr8AJ8AAKdxG7Is1uKPPtejZuTBhqRWBFF5YxYa9biW0RC-sdSDhz1Xlk_GDXKC54PYw4Fj4bTDPdDi8G6iX/s1600/green+flag+and+stop.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="101" data-original-width="148" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj83XB7H55AJHaKVQpEePiEdBrypMxnNZ_b_dFUT0GiaJmkSL5Y2Z5TGGelmr8AJ8AAKdxG7Is1uKPPtejZuTBhqRWBFF5YxYa9biW0RC-sdSDhz1Xlk_GDXKC54PYw4Fj4bTDPdDi8G6iX/s1600/green+flag+and+stop.png" /></a></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b>The Green Flag and the Stop signs</b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
Above the stage area there are two distinct symbols. One is a Green Flag and other is a Red colored stop sign. The Green flag is used to start your Scratch script, and preview it in the stage area. And the Red stop sign is used to stop the script. You will need to use these two buttons often to run and to stop your scratch code.<br />
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><b><span style="font-size: 14pt;"><br /></span></b></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><b><span style="font-size: 14pt;"><br /></span></b></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><b><span style="font-size: 14pt;">The Script Area</span></b></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3Og1YJR7lK1IGW81ocvuIVbOJUU_7Q1L80RLctG573XtfHyMQ8KukXKDzcb9cC08IOdwlSQQBT7e8YBSuJA-CPn1TLliIkJppg6Ajh_E53cTcKB7qysb2NvP_-Y_3i3RPTzf6CsLt8fHz/s1600/script-area.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="362" data-original-width="535" height="135" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3Og1YJR7lK1IGW81ocvuIVbOJUU_7Q1L80RLctG573XtfHyMQ8KukXKDzcb9cC08IOdwlSQQBT7e8YBSuJA-CPn1TLliIkJppg6Ajh_E53cTcKB7qysb2NvP_-Y_3i3RPTzf6CsLt8fHz/s200/script-area.png" width="200" /></a></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
The middle portion of the Scratch 3 editor is used as the script area. You can drag the code from the “Code palette” into this area and create scripts. You can also drag a code block from this area to the left pane so that you can remove or delete that code block.</div>
<br />
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b>Adding a sprite</b></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUCclD0fevkz8JEQX-wBQZ601o8s2ApP6mTFEWbMX-efL4qZnRY0pEgBb5PMgbljgx8PXFicUrYkiwFOK2KQKojSbYLHZ6tCuhPQfoYEJwjm9JgLpMOM_4WKKNueLEqz76dMx7ZXVsygFk/s1600/choose-a-sprite.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="276" data-original-width="265" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUCclD0fevkz8JEQX-wBQZ601o8s2ApP6mTFEWbMX-efL4qZnRY0pEgBb5PMgbljgx8PXFicUrYkiwFOK2KQKojSbYLHZ6tCuhPQfoYEJwjm9JgLpMOM_4WKKNueLEqz76dMx7ZXVsygFk/s1600/choose-a-sprite.png" /></a></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<br />
You can add new (images) sprites in your project. When you take the mouse pointer on the cat-head icon in the sprite-info pane, you will see a menu pop up. If you click on the magnifying glass icon, it will open a new page in the Scratch library of images, where you will be able to choose any image you like.<br />
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<br />
<div class="separator" style="clear: both;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXQNasEcxwWwOOS1q-tk0joYqFMQMXg9kUiXUtiMMcO3lzZaAwaKlbcZzTTWRbP-Tf4HV4iLjMggiIcUbC1QoqA3R8E-XsaCR35007DysPOevGHlOChjZCxHxrG0Gventq2ZkpbzqtWnCP/s1600/scratch-image-library.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="450" data-original-width="800" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXQNasEcxwWwOOS1q-tk0joYqFMQMXg9kUiXUtiMMcO3lzZaAwaKlbcZzTTWRbP-Tf4HV4iLjMggiIcUbC1QoqA3R8E-XsaCR35007DysPOevGHlOChjZCxHxrG0Gventq2ZkpbzqtWnCP/s320/scratch-image-library.png" width="320" /></a></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
The brush icon called paint open an image editor, where you can draw an image to add it in your project.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAmLqghiCu7FdtGEbD39Bh2Din2BiyswDks3KDEa-0iQXrYOJdVRcVx06RbrCH-hUd1B9oDYKJNCCBX3P86bIOyR1VDVJA7PxYUJqDi8FNqaNyQViSJo5PhD5hBlrx9p9VVJZHS_QCIydm/s1600/paint-in-scratch.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="673" data-original-width="804" height="267" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAmLqghiCu7FdtGEbD39Bh2Din2BiyswDks3KDEa-0iQXrYOJdVRcVx06RbrCH-hUd1B9oDYKJNCCBX3P86bIOyR1VDVJA7PxYUJqDi8FNqaNyQViSJo5PhD5hBlrx9p9VVJZHS_QCIydm/s320/paint-in-scratch.png" width="320" /></a></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
The topmost icon is for uploading any image that is available on your computer. You can use any image from your computer to be used as a sprite in your project.<br />
<br />
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b>Changing a backdrop</b></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKj803dgeu8gYxPTk5fXp52cXGmIwmWobG-n1Iei_XVVDDuDoBiu4R67MCcNaviM6-qD2U5vEvJz1H_lBcHZNXbRCuJ4dirTC5K2PhKeM37MHRo3VhtsQe_AAhnnk0FjPj38og_c8ON8xe/s1600/stage-info.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="284" data-original-width="268" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKj803dgeu8gYxPTk5fXp52cXGmIwmWobG-n1Iei_XVVDDuDoBiu4R67MCcNaviM6-qD2U5vEvJz1H_lBcHZNXbRCuJ4dirTC5K2PhKeM37MHRo3VhtsQe_AAhnnk0FjPj38og_c8ON8xe/s1600/stage-info.png" /></a></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div>
<br /></div>
In the right of sprite info pane, there is a stage-pane. You will see an image icon there. If you take the mouse pointer on it, a menu pops up with a message “Choose a backdrop”. If you click on the magnifying glass icon, it opens the backdrop library. You can choose any background image here for your project.<br />
<br />
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #5983b0;"><b><span style="font-size: 14pt;"><br /></span></b></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #5983b0;"><b><span style="font-size: 14pt;"><br /></span></b></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #5983b0;"><b><span style="font-size: 14pt;"><br /></span></b></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #5983b0;"><b><span style="font-size: 14pt;"><br /></span></b></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #5983b0;"><b><span style="font-size: 14pt;"><br /></span></b></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #5983b0;"><b><span style="font-size: 14pt;"><br /></span></b></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #5983b0;"><b><span style="font-size: 14pt;"><br /></span></b></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #5983b0;"><b><span style="font-size: 14pt;"><br /></span></b></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #5983b0;"><b><span style="font-size: 14pt;"><br /></span></b></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #5983b0;"><b><span style="font-size: 14pt;">A</span><span style="font-size: 14pt;">dd Extension</span></b></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHJKjS-RjIEVkv9LkmSAkjTl5KpXEkBj86xiQhQdgQ5PZVZpxYC9toEjXj-ka1-s4SeC-J8LoDIeZ5lon0Rji2T1IU1k1i7jjX47eUrq0-BpkcKtcsNFYFTo8vWZVJ3ZJWFnxllLQMVEcH/s1600/add-extension.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="768" data-original-width="1366" height="179" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHJKjS-RjIEVkv9LkmSAkjTl5KpXEkBj86xiQhQdgQ5PZVZpxYC9toEjXj-ka1-s4SeC-J8LoDIeZ5lon0Rji2T1IU1k1i7jjX47eUrq0-BpkcKtcsNFYFTo8vWZVJ3ZJWFnxllLQMVEcH/s320/add-extension.png" width="320" /></a></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
If you click on the icon in the bottom-left corner of the Scratch Editor, (It is called Add-extension) It will open a new page that shows several extensions like Music, Pen, Text-to-speech etc. If you choose any of them, it will create a new Category in the blocks-palette. And you will see many new blocks in that category. We will study the music extension and the pen extension in this lesson.<br />
<br />
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><b><span style="font-size: 14pt;">Saving a project</span></b></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1RgLjrxtczLlRjRsDnIxzWgo0W-UbJNmroMPDaufhK2oaMOxjqvAxwvtjCcUV7KeIYUQQbXkqFMMbTjN_lEjNOs24WnEF4f3gum8RTBTnjOTZlBngO62bvwdRSHVERiJxSBq02lTShDnY/s1600/file-save-as.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="178" data-original-width="297" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1RgLjrxtczLlRjRsDnIxzWgo0W-UbJNmroMPDaufhK2oaMOxjqvAxwvtjCcUV7KeIYUQQbXkqFMMbTjN_lEjNOs24WnEF4f3gum8RTBTnjOTZlBngO62bvwdRSHVERiJxSBq02lTShDnY/s1600/file-save-as.png" /></a></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<br />
When you have done some work in your new scratch project, you can save it.<br />
To do that Click on File menu in the Toolbar and choose “Save to your computer”<br />
It will show the folder on your computer. You need to select here the right folder where you want to save your scratch project. You should remember the folder name, otherwise you will find it difficult to find your scratch project on your computer. You need to give a name to your project. Once it is saved, it will have an extension .sb3 , That is the file extension of the Scratch 3 editor. If you need to save your file again after some time you can select the previous file name again and overwrite it, or you can give a new name such as myproject-v1, myproject-v2 etc. Scratch offline editor does not save your file automatically. You need to save it yourself each time.<br />
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><b><span style="font-size: 14pt;">Opening an existing project</span></b></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
If you want to open your project at some other time, you need to click on File – Load from your computer, and then open the folder where your scratch projects are saved, and then select the sb3 file, that will open the scratch project in the scratch editor.<br />
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><b><span style="font-size: 14pt;">Closing a project</span></b></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0BeutpSOmo78KiQpz6Dosl6sTv9mqWMqMVKYEYpsH41DdQdASHBlNXolzeY8Rp2FQLbg5B55kiWF_qhX3pqreUJrEhwhskSiYhyphenhyphenN19hgsm9qnWjEehEBUxaxzOO1zGehN8ike4SUn505V/s1600/close.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="235" data-original-width="417" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0BeutpSOmo78KiQpz6Dosl6sTv9mqWMqMVKYEYpsH41DdQdASHBlNXolzeY8Rp2FQLbg5B55kiWF_qhX3pqreUJrEhwhskSiYhyphenhyphenN19hgsm9qnWjEehEBUxaxzOO1zGehN8ike4SUn505V/s320/close.png" width="320" /></a></div>
<br /></div>
You can close the editor by clicking on the x sign at the top right corner of the editor. That will show you this dialog box. If you have not saved your project then you can<br />
select to Stay, then save the project. If you have already saved your project then select to Leave. That will close the Scratch Editor.<br />
<br />
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 20pt;"><b>Block Categories</b></span></span><span style="color: #3465a4;"><span style="font-size: 20pt;"><b> in Scratch</b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 18pt;"><b>Motion Blocks</b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 18pt;"><b><br /></b></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzkpk0oOZV39dc2F5Rq8tRqHFHM2Y5NumFhopKa19YFvTwH7vJq6ZrwETUfACIQCezj0kPgDoLoIoDOdoseZU4k7bYVOC1nyCsEmIjwbcSZKivG1TaIjt37wO9AvNEwRHhzjQzNvapy5XZ/s1600/motion-blocks1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="616" data-original-width="331" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzkpk0oOZV39dc2F5Rq8tRqHFHM2Y5NumFhopKa19YFvTwH7vJq6ZrwETUfACIQCezj0kPgDoLoIoDOdoseZU4k7bYVOC1nyCsEmIjwbcSZKivG1TaIjt37wO9AvNEwRHhzjQzNvapy5XZ/s320/motion-blocks1.png" width="171" /></a></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
Motion blocks is one of the categories of blocks in Scratch. They are color coded medium blue and are used to control sprite movement.<br />
<br />
The blocks that can be arranged one below the other are known as Stack blocks. There are 15 such blocks in the Motion category.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdZPA1B0S6fKG8oW32hdUpyigZPUpWpyoC_W0i5as92xz58PsM0YoCgLBWRM8m0FEnPRBAdk3LQHi7iRqXUMuH1ROPDddR3JEHYPYf9pPTC2P3ln_Z44BjQPyTwYai4usV3QE8Atf7vcXE/s1600/motion-blocks2.png"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdZPA1B0S6fKG8oW32hdUpyigZPUpWpyoC_W0i5as92xz58PsM0YoCgLBWRM8m0FEnPRBAdk3LQHi7iRqXUMuH1ROPDddR3JEHYPYf9pPTC2P3ln_Z44BjQPyTwYai4usV3QE8Atf7vcXE/s1600/motion-blocks2.png" /></a><br />
The blocks that give certain information into the script are called “Reporter blocks”. There are 3 reporter blocks in the Motion category.<br />
<br />
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 18pt;"><b>Looks Blocks</b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNI_zoVVtcVyZCTOeExCrPg4cHb5tFVa9g-MzNFMJGyuY1mHnjDmTPBRK2z5615DbI18htuanVbbO3EMaB2y2kFYZ1bM72takUcd4p5HreH1U4YvEzs_O40bb6jwL7S25umJxOy2iq9N4Q/s1600/Looks-blocks1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="541" data-original-width="333" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNI_zoVVtcVyZCTOeExCrPg4cHb5tFVa9g-MzNFMJGyuY1mHnjDmTPBRK2z5615DbI18htuanVbbO3EMaB2y2kFYZ1bM72takUcd4p5HreH1U4YvEzs_O40bb6jwL7S25umJxOy2iq9N4Q/s320/Looks-blocks1.png" width="196" /></a></div>
<br />
<br />
The Looks category blocks are color-coded Purple. These blocks are used to control a sprite’s appearance.<br />
<br />
There are 17 Stack blocks and three Reporter blocks in this category.<br />
<br />
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdFF5ghlANR1RQjkIQAGaIGOOmO6lr9iGO8NNYjknmnFTaIQ5ZOlSROt3DQgnVRR7T9zvJk0A6Y7KOv0qT4gGmtO0CkbXZkJW0cFFwthrigNjmArPySMaFCGfVled8ArGYsvOtzsPKSwv8/s1600/Looks-blocks2.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="143" data-original-width="229" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdFF5ghlANR1RQjkIQAGaIGOOmO6lr9iGO8NNYjknmnFTaIQ5ZOlSROt3DQgnVRR7T9zvJk0A6Y7KOv0qT4gGmtO0CkbXZkJW0cFFwthrigNjmArPySMaFCGfVled8ArGYsvOtzsPKSwv8/s1600/Looks-blocks2.png" /></a></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 18pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 18pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 18pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 18pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 18pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 18pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 18pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 18pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 18pt;"><b>Sound Blocks</b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
Sound bocks are color-coded Pink/Magenta. These blocks are used to control/add sound and MIDI functions.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRdovgkHHSdzhYaXdKcN-Pk7445nOQm7R7CJwiaCDys5uAmaDAWhxGRzxXXhK8vYlzmp_x-5tBsguF62N9dZ41tGcAV5TKHPtCGXUlUJQ6N5AIZJn7iyiFQyhZYFaYT5Q48OnH7vMHA39l/s1600/sound-blocks.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="505" data-original-width="333" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRdovgkHHSdzhYaXdKcN-Pk7445nOQm7R7CJwiaCDys5uAmaDAWhxGRzxXXhK8vYlzmp_x-5tBsguF62N9dZ41tGcAV5TKHPtCGXUlUJQ6N5AIZJn7iyiFQyhZYFaYT5Q48OnH7vMHA39l/s400/sound-blocks.png" width="263" /></a></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<b style="color: #3465a4; font-size: 18pt;"><br /></b></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<b style="color: #3465a4; font-size: 18pt;"><br /></b></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<b style="color: #3465a4; font-size: 18pt;"><br /></b></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<b style="color: #3465a4; font-size: 18pt;"><br /></b></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<b style="color: #3465a4; font-size: 18pt;"><br /></b></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<b style="color: #3465a4; font-size: 18pt;"><br /></b></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<b style="color: #3465a4; font-size: 18pt;">Music Blocks</b></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJFB0S8oHsJr7Rn96aMX3F3FQKtPaF1lRZfGsNXgfriBHdhocTHRT1F-7lznPqi86ZkUyB2g_JBoarLGUJUS_XHKiDAW2ChM0dLlF_kcAhnwYpMwd-lY8KSSkkESx6HRlVC_vWiCk7u6YH/s1600/music.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="480" data-original-width="323" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJFB0S8oHsJr7Rn96aMX3F3FQKtPaF1lRZfGsNXgfriBHdhocTHRT1F-7lznPqi86ZkUyB2g_JBoarLGUJUS_XHKiDAW2ChM0dLlF_kcAhnwYpMwd-lY8KSSkkESx6HRlVC_vWiCk7u6YH/s400/music.png" width="268" /></a></div>
</div>
These blocks are added as an extension. They are color-coded Green. They can be used to generate musical notes of different instruments in your Scratch project. It is a music making tool. You need to have a teacher who understands musical composition to make god use of this extension. You will have fun in using this extension which can create music through programming.<br />
If you click on the instrument name, you will see a list of dozens of musical instruments to choose from, and you can select the node and beat value for that instrument to play.<br />
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 18pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 18pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 18pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 18pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 18pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 18pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 18pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 18pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 18pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 18pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 18pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 18pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 18pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 18pt;"><b>Control Blocks</b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
Control blocks are color-coded in Golden color. These are used to control the script.<br />
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihkW3Z6JBLlpVWZyDm16rExjtBYCDsdhVUlwrrKRRRuWiv_NB4OrPtYMhBlDaqVVQJVjrXvkJ4mry54E6EGCk73Ea-w5XprToSyvLwab6W9r2Wg-dHjvJ_ceRB2nKXdWQ5WKm9E2_vLIrA/s1600/control-blocks1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="625" data-original-width="320" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihkW3Z6JBLlpVWZyDm16rExjtBYCDsdhVUlwrrKRRRuWiv_NB4OrPtYMhBlDaqVVQJVjrXvkJ4mry54E6EGCk73Ea-w5XprToSyvLwab6W9r2Wg-dHjvJ_ceRB2nKXdWQ5WKm9E2_vLIrA/s400/control-blocks1.png" width="203" /></a></div>
<br />
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoU_ZGtDKIFlkv5d343LBtGUqvHD6ODptgbRaaO6FI3TUad5XTkEmY5S731Ippaidrrkm-CZ-vt4D876J4Y_jW4ep9pwsIlQhkvpC2fH_0ACnQBImd8svmjvIqyhyphenhyphenVBdGV_pSv5p8FAomL/s1600/control-blocks2.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="240" data-original-width="210" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoU_ZGtDKIFlkv5d343LBtGUqvHD6ODptgbRaaO6FI3TUad5XTkEmY5S731Ippaidrrkm-CZ-vt4D876J4Y_jW4ep9pwsIlQhkvpC2fH_0ACnQBImd8svmjvIqyhyphenhyphenVBdGV_pSv5p8FAomL/s200/control-blocks2.png" width="175" /></a></div>
There are 1 Hat block, 5 C type blocks, 3 Stack blocks and 2 Cap blocks. Cap blocks are the ones that are at the bottom of the script. C type blocks are those, which can include other blocks inside them. They are also called Loops. Hat block is the one that is at the top of a script.<br />
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
</div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="color: black;"></span></span><br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<h3>
Commonly used blocks in Scratch</h3>
<br />
Move, Turn, Say, Think, Change-color effect, Play-sound, Play-drum, Wait, Forever.<br />
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"></span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdbyXEXI1vavbDTCiIdrBY06v2750e1wqS8JAilxV_7BzlfZF7Osrg3cJv67oXwv-1Jmfuzlh2CPlViCyQU5YgzIVGgOZpZ60wI7c2lfcGt9I6wVM6ANe-WPc4Wi1t4jUpNLO09BFTngPk/s1600/blocks2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="233" data-original-width="295" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdbyXEXI1vavbDTCiIdrBY06v2750e1wqS8JAilxV_7BzlfZF7Osrg3cJv67oXwv-1Jmfuzlh2CPlViCyQU5YgzIVGgOZpZ60wI7c2lfcGt9I6wVM6ANe-WPc4Wi1t4jUpNLO09BFTngPk/s1600/blocks2.png" /></a></div>
<br />
<b>Move block – </b>This block is found in the Motion category. It will move the sprite a number of steps in the current direction. The value is 10 when you add this block. You can type in any number in the box. You can make the sprite move in the opposite direction if you type a negative number.<br />
<br />
<b>Turn </b>– This block is found in the Motion category. There are two types of turn blocks, Clockwise and Anti-clockwise. When you add these blocks, there is 15 written in it. It will turn the sprite 15 degrees. You can type any number in it (0 to 360).<br />
<br />
<b>Say </b>– This block This block is found in the Looks category. It will add text in a speech bubble. When you add this block, there is “Hello” written in there. You can type anything you like in the box.<br />
<br />
<b>Think</b> – This block This block is also found in the Looks category. It is similar to the Say block, except, it is not addressed to anyone. You can use this block, if you want to show that your sprite character is thinking something. It is useful if you are creating a story using scratch.<br />
<div>
<br /></div>
<div>
<b>Change Effect by -</b> </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGqeQPrkUn1Oyu6yUEJOKzOjd0l3v2xHAZIVRYTQ1gkxS_xlHgf5UXXeQXXGjmP39De8qmVYrqp24iXax_KDVGvusAIepky3b3MhaU6DfL_-THAlVucCmjy3d6iCC0lD-KmMP4MVwu1_vZ/s1600/change-effect.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="337" data-original-width="258" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGqeQPrkUn1Oyu6yUEJOKzOjd0l3v2xHAZIVRYTQ1gkxS_xlHgf5UXXeQXXGjmP39De8qmVYrqp24iXax_KDVGvusAIepky3b3MhaU6DfL_-THAlVucCmjy3d6iCC0lD-KmMP4MVwu1_vZ/s320/change-effect.png" width="244" /></a></div>
<div>
<br /></div>
<div>
This block This block is also found in the Looks category.</div>
<div>
You will find a list of 7 different effect to choose from. The already written value ids 25.<br />
You can type a different number ( from 0 to 100 or -100)<br />
You can change the color, brightness and visibility of the sprite. You can also make some visual effects such as fisheye, whirl, pixelate and mosaic.<br />
<br />
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b><br /></b></span></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<span style="color: #3465a4;"><span style="font-size: 14pt;"><b><br /></b></span></span></div>
<br />
<br />
<b>Play sound - </b></div>
<div>
<b><br /></b></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIoKrV8JbFC00_71GSOQUxmYp1qCu9oYM_gpdNovKtVXwzFoHOhFMtJErO2Hlb3HJAuuaLUd6lRt9pny0PpGJKBWl7IpMgSuNVKuOL6_8bJbhoPk9Xvyg_zSBVC_gNu_NHnezn1FPwh6CM/s1600/sound2.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="134" data-original-width="271" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIoKrV8JbFC00_71GSOQUxmYp1qCu9oYM_gpdNovKtVXwzFoHOhFMtJErO2Hlb3HJAuuaLUd6lRt9pny0PpGJKBWl7IpMgSuNVKuOL6_8bJbhoPk9Xvyg_zSBVC_gNu_NHnezn1FPwh6CM/s1600/sound2.png" /></a></div>
<div>
<br /></div>
<br />
<div>
This block is found in the Sound category. When you add any sprite, and then add this block, you will see one or two sounds that are suitable for the sprite. You can additionally add more sounds if you want by clicking on the Sounds tab at the top left corner of the screen. Or you can even record your own voice if you want.<br />
<br />
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<b>Play Drum -</b></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9OIccP1_abGzqfK_t9DS4Zm6mCziqO69BNxOKzuk1emmG4sCQvvGx4k3E3Z5kEI23L9KHp2oC3sUfvmRZxcvEKM9rypSQx3ShOdtPFd7owWOoRLGJl4OM8AtT_EF78NHxSE8NSPWTSIh/s1600/play-drum.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="415" data-original-width="399" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9OIccP1_abGzqfK_t9DS4Zm6mCziqO69BNxOKzuk1emmG4sCQvvGx4k3E3Z5kEI23L9KHp2oC3sUfvmRZxcvEKM9rypSQx3ShOdtPFd7owWOoRLGJl4OM8AtT_EF78NHxSE8NSPWTSIh/s320/play-drum.png" width="307" /></a></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
You will find this block in the newly created Music category if you have added the music extension in your Scratch Editor.<br />
The play drum block has a list of 18 different instruments to choose from. And you can specify the beats.</div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjll6xMsTFE48O0Whfr9KuWtVWHeP4rHaxjp9efsx9k60zMM-Q-hAlECIrUKlNkN-pbbUpV-C5m2z_hQV5OeJL-pkwfq29AJ51wqWxTg7mfGXIfsCyOWaomEsp9e3crlGwFD5iupxveVmI0/s1600/wait.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="103" data-original-width="176" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjll6xMsTFE48O0Whfr9KuWtVWHeP4rHaxjp9efsx9k60zMM-Q-hAlECIrUKlNkN-pbbUpV-C5m2z_hQV5OeJL-pkwfq29AJ51wqWxTg7mfGXIfsCyOWaomEsp9e3crlGwFD5iupxveVmI0/s1600/wait.png" /></a></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<b><br /></b></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<b>Wait - </b>This is a golden colored Control block. You can use this block to make things wait for as long as you want. There is 1 seconds written when you add this block. You can add a bigger number to make it wait longer. This is a Stack type block. Yo u can add other blocks above and below this one.</div>
<br />
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16px; margin-bottom: 0in;">
<br /></div>
<div>
<br /></div>
<b>Forever -</b> This is also a control block. It is called a C type block because it looks like a C. It is also called a Loop. We can add other blocks above, and below this block, but also we can add other blocks inside this block. Whatever we add inside this block, will run on and on till we do not stop it with Stop block , or by pressing the Red stop button.<br />
<br /></div>
<div>
<div class="separator" style="clear: both;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2E0xDBCBAdaChfnQgGNd_ucW9SULfAq0uAXj5xu9HF3VHChg0MkfuiRkE5gx1qnaAonZzWAd9Vc9FH_lLcz4hOCyVK55AbwfMGtXPpDDYbZM6gAaMXU9wtixKAv0joJljSBtG8hEZ1dbt/s1600/stop-all.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="209" data-original-width="310" height="134" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2E0xDBCBAdaChfnQgGNd_ucW9SULfAq0uAXj5xu9HF3VHChg0MkfuiRkE5gx1qnaAonZzWAd9Vc9FH_lLcz4hOCyVK55AbwfMGtXPpDDYbZM6gAaMXU9wtixKAv0joJljSBtG8hEZ1dbt/s200/stop-all.png" width="200" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijuH3uPY_uOZ_baDIDwi-20PdY-GKzsjynyxN9v_on8iBuZ05zJj88lAHe07Ja-WjT5HBMfnocIMtDVGRqZIiE5WBepQzgchzNxiwr9SlAfHJFfAsasrVvv3zpRcyGaamzfmvdBfHIivAV/s1600/forever.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="136" data-original-width="181" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijuH3uPY_uOZ_baDIDwi-20PdY-GKzsjynyxN9v_on8iBuZ05zJj88lAHe07Ja-WjT5HBMfnocIMtDVGRqZIiE5WBepQzgchzNxiwr9SlAfHJFfAsasrVvv3zpRcyGaamzfmvdBfHIivAV/s1600/forever.png" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijuH3uPY_uOZ_baDIDwi-20PdY-GKzsjynyxN9v_on8iBuZ05zJj88lAHe07Ja-WjT5HBMfnocIMtDVGRqZIiE5WBepQzgchzNxiwr9SlAfHJFfAsasrVvv3zpRcyGaamzfmvdBfHIivAV/s1600/forever.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a></div>
<div class="separator" style="clear: both;">
Let us see some action in the video tutorials below. </div>
<h3>
<span style="color: #38761d;">Tutorial 1</span></h3>
<div class="separator" style="clear: both; text-align: center;">
<br /><iframe width="320" height="266" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/7jj6o1GqbCo/0.jpg" src="https://www.youtube.com/embed/7jj6o1GqbCo?feature=player_embedded" frameborder="0" allowfullscreen></iframe></div>
<h3>
<span style="color: #6aa84f;">Tutorial 2</span></h3>
<div class="separator" style="clear: both; text-align: center;">
<br /><iframe width="320" height="266" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/-W4BPM5CfwM/0.jpg" src="https://www.youtube.com/embed/-W4BPM5CfwM?feature=player_embedded" frameborder="0" allowfullscreen></iframe></div>
<div>
<b><span style="color: #6aa84f;">Tutorial 3</span></b></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /><iframe width="320" height="266" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/vofaBcE0994/0.jpg" src="https://www.youtube.com/embed/vofaBcE0994?feature=player_embedded" frameborder="0" allowfullscreen></iframe></div>
</div>
Sanjay Rajurehttp://www.blogger.com/profile/11542442972509970207noreply@blogger.comtag:blogger.com,1999:blog-2679287135209666721.post-2719442246623190002020-01-18T12:30:00.000+05:302020-01-18T12:30:27.165+05:30Create a Game in Scratch3 - Lion and the Knight<div class="separator" style="clear: both; text-align: center;">
<iframe width="320" height="266" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/fF6322x0YiM/0.jpg" src="https://www.youtube.com/embed/fF6322x0YiM?feature=player_embedded" frameborder="0" allowfullscreen></iframe></div>
Hello friends, This is a new video tutorial I have brought for you. This time it is Scratch 3, the latest version of the MIT's Scratch editor. If you do not have the offline editor installed on your computer, you can download it <a href="https://scratch.mit.edu/download" rel="nofollow" target="_blank">from this link. </a><br />
<br />
I have created this video in quite detail. I have recorded the entire game development process. The video runs for about more than half an hour. If you like to code in Scratch and you are interested in creating a game of your own, then this video tutorial will give you a first hand experience of doing it.<br />
You can also watch the game that I have uploaded on the MIT's Scratch website <a href="https://scratch.mit.edu/projects/359954444/" rel="nofollow" target="_blank">from this link</a>.<br />
<br />
I have created this new youtube channel by keeping kids in mind. Do not forget to subscribe to my <a href="https://www.youtube.com/channel/UCjQUhPT8N9yaoul-HOh_48A?" rel="nofollow" target="_blank">new Youtube channel.</a><br />
<br />
<br />
<br />
<br />Sanjay Rajurehttp://www.blogger.com/profile/11542442972509970207noreply@blogger.comtag:blogger.com,1999:blog-2679287135209666721.post-63331873222982810512019-05-12T17:16:00.002+05:302019-05-18T20:18:43.781+05:30The HC-05 Bluetooth Module with Arduino<h3 style="text-align: center;">
Using Bluetooth module with Arduino</h3>
<br />
Hello friends, let us learn how to connect a HC-05 Bluetooth Transmitter/ Receiver module with a Arduino Uno. And use it to communicate with a mobile smartphone to turn on/ off electrical load/equipment/light connected to the Arduino through a Relay.<br />
<br />
<div style="text-align: center;">
<b>The HC-05</b></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzw65Eu6omnkYxUBoufsPzOvyATanyLwkkugUJ6hfxtMwOfeIrMTdiMMgVmPOZjaDtQyLDuyM-X8ZbrNf1DzM4EhLfk8kUxe7-X1lnbzkhDlvxejZPKJZHgFjntjeFBvfXIRdVkUwG1sfN/s1600/module+both+side+blog.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="511" data-original-width="664" height="246" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzw65Eu6omnkYxUBoufsPzOvyATanyLwkkugUJ6hfxtMwOfeIrMTdiMMgVmPOZjaDtQyLDuyM-X8ZbrNf1DzM4EhLfk8kUxe7-X1lnbzkhDlvxejZPKJZHgFjntjeFBvfXIRdVkUwG1sfN/s320/module+both+side+blog.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
I purchased this module from Amazon India. You can also find one for your self <b><a href="https://amzn.to/2Hk4FZb" target="_blank">on this link.</a></b><br />
<a name='more'></a><br />
<br />
This is the most used and suitable module for the kind of projects that we are doing here. There is also a newer module available named HC-06 on Amazon, Initially I was tempted to buy the newer version as it was already available. But then soon realized that HC-05 module has a button on it that can be used for entering AT command mode. HC-05 can thus be used either as a master or a slave. HC-05 can initiate connection with other devices. Whereas the HC-06 module is to be used only as a slave mode. Thus it can be only used to accept connections from other devices. Therefore I decided to stay with HC-05 module.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0CX6CxOsyB4G6Y-xzhb8nCuDSp9ZZuSkQ0xIaSWGlgP-DPq1hYw25ySk8BZIbVJTtEbIwNt8D7RcC4cbtqY69_WWsHaSBjkisdspopZ6z4cS9z-GkreHKtmRDhJ-3BfqRGXIHn0tWVQbQ/s1600/pins.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="500" data-original-width="559" height="285" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0CX6CxOsyB4G6Y-xzhb8nCuDSp9ZZuSkQ0xIaSWGlgP-DPq1hYw25ySk8BZIbVJTtEbIwNt8D7RcC4cbtqY69_WWsHaSBjkisdspopZ6z4cS9z-GkreHKtmRDhJ-3BfqRGXIHn0tWVQbQ/s320/pins.jpg" width="320" /></a></div>
<br />
<br />
If you notice in the above image, the pins are marked promptly. We are going to need only four pins in it. The VCC and GND can be connected to Arduino 3.3V and GND Pins respectively. Although this module can be connected to 5V pin on Arduino, but what I read elsewhere is that it can operate well with 3.3V and 5V input can be excessive for it. So to be on the safer side, I chose to connect it to 3.3V pin on Arduino.<br />
<br />
There are two pins RXD and TXD there Receiver and Transmitter respectively.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKg3ikLx0nLiOAJ73oI3wo37QfgNQKNsneCnmKCl4ZmzrJr-Xza5jPoD690MdthJTtYaLcI-ngKpAldU-71brnHkq9Gme5Ji6cbTWeCEbJnNDJqwcTedyXraA2jC_9cqnt727nqepz66C9/s1600/arduino+txrx.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="819" data-original-width="1226" height="213" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKg3ikLx0nLiOAJ73oI3wo37QfgNQKNsneCnmKCl4ZmzrJr-Xza5jPoD690MdthJTtYaLcI-ngKpAldU-71brnHkq9Gme5Ji6cbTWeCEbJnNDJqwcTedyXraA2jC_9cqnt727nqepz66C9/s320/arduino+txrx.jpg" width="320" /></a></div>
<br />
<br />
<br />
If you notice on the Arduino board (Uno) you will see TX and Rx pins at the location of pin number 0 and 1 . These are the serial communication ports that send and receive data in the ATMEGA 328P microcontroller. We can connect the TXD and RXD of the Bluetooth module to RX and TX of the Arduino board. Remember here TXD goes to RX and RXD goes to TX. That is how the bluetooth and the micro controller will communicate.<br />
☹️ The common error that can happen here is to connect RXD to RX and TXD to TX pins.<br />
<br />
As we will be using the TX and RX pins of the Arduino directly, it will interfere with our Arduino sotware, when we will try to upload the code on the Arduino board. So at this stage, right before you want to upload some code to Arduino, remove the wires from RX and TX of Arduino. Once the Upload is completed, you can re insert the wires back (but remember the configuration. Don't connect similar ports to each other)<br />
<br />
So this is how you will wire a bluetooth module to a Arduino board. It is better to use a breadboard to insert the bluetooth module, and connect wires. As we will be connecting 3.3 to VCC, and 5V from Arduino to VCC of the Relay. We will need the extra space on the breadboard to accommodate all the wires.<br />
<br />
<h2 style="text-align: center;">
Testing HC-05 module with Arduino</h2>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/-d1o9ag8Aak/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/-d1o9ag8Aak?feature=player_embedded" width="320"></iframe></div>
<div>
<br /></div>
<div>
You can connect the HC-05 module with Arduino as below</div>
<div>
<br /></div>
<div>
VCC - 3.3 v</div>
<div>
GND - GND</div>
<div>
TXD - RX</div>
<div>
RXD - TX</div>
<div>
<br /></div>
<div>
After that, connect a LED on the breadboard to a 330 Ohms resistor. And Connect the (+ve) Cathode of the LED with the Pin 7 on Arduino. </div>
<div>
<br /></div>
<div>
The program that we are using for this experiment is this</div>
<div>
<br /></div>
<div>
void setup() {</div>
<div>
Serial.begin(9600);</div>
<div>
pinMode(7, OUTPUT);</div>
<div>
digitalWrite(7, LOW);</div>
<div>
}</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
void loop() {</div>
<div>
if(Serial.available()>0)</div>
<div>
{ </div>
<div>
char x = Serial.read();</div>
<div>
switch(x)</div>
<div>
{</div>
<div>
case 'a': digitalWrite(7, HIGH);break; </div>
<div>
case 'b': digitalWrite(7, LOW);break;</div>
<div>
default : break;</div>
<div>
}</div>
<div>
delay(50);</div>
<div>
} //end switch</div>
<div>
} //end loop </div>
<br />
<br />
// We have declared pin 7 as output pin, therefore we will connect it with the LED.<br />
//Serial.begin() establishes serial communication between the bluetooth module and it's serial ports (TX, RX)<br />
// digitalWrite(7,LOW) keeps the LED Off at start<br />
//we can check if there is any data present at the Serial port by Serial.available() function<br />
// We need to declare a char variable to store this data and then use it in the program in switch-case<br />
// We are using a character in the case statement. On your smartphone, in the Bluetooth Serial Terminal Pressing 'a' will turn the LED On, and pressing 'b' will turn it off. If you get accustomed to the Terminal, then there will be no constraint on you if you decide to control multiple ports on Arduino, all you need to do is to append extra code in the case statement, and of course declare the ports as output in the setup() function.<br />
<br />
Some of the apps that provide graphical interface to turn on/off Arduino pins are restrained in their number of ports, so there is no need to get frustrated using them. Using a Bluetooth Terminal is the best way to conduct this experiment. In fact you can control all the digital I/O ports ( from 2 to 13) with ease using bluetooth terminal. <br />
<br />
We will try to connect multiple ports in the next experiment.<br />
<br />
You can download the program <b><a href="https://drive.google.com/open?id=1iZz4sK-dcRUef-K-BKQQ8rqCBEPGG5it" target="_blank">from this link</a></b><br />
<br />
I have used an App called Arduino Bluetooth Terminal by Fredrik Hauke. You can install it <b><a href="https://play.google.com/store/apps/details?id=com.frederikhauke.ArduTooth" target="_blank">from here</a></b><br />
<br />
<h3 style="text-align: center;">
Adding a Voltage divider in the circuit</h3>
We need to add a voltage divider between the TX pin of Arduino and The RXD pin of the HC-05 module.<br />
This is because the signal sent by arduino through it's TX pin 5v and the signal level of the HC-05 is 3.3v. The 5v sent by Arduino through its TX pin can be brought down with a voltage divider.<br />
We will use two extra resistors for this. 1 K and 2 K .<br />
We will place these resistors on the breadboard. One end of the 2K resistor in the common rail of the breadboard. Connect one end of the 1 K resistor to the same row after the 2K resistor, leaving a few holes for the wire coming from the RXD pin of HC-05. Insert the other end of the 1 K resistor in the other side of the breadboard. Connect a wire to the other end of this 1K resistor to the TX pin of Arduino. Thus our voltage divider circuit is complete.<br />
Now connect the Gnd pin of arduino to the common rail.<br />
Connect the Gnd pin of HC-05 to common rail.<br />
Connect Vcc of HC-05 to 3.3 v pin on arduino.<br />
Connect TXD pin of HC-05 to RX pin of arduino.<br />
Connect +ve pin of led to the pin 7 of arduino<br />
The completed wiring would look something like this.<br />
<br />
<h3 style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4rW2aCtMM3pun5tm6881B8VFxv9HYM7vf3SfHIjj62c_3EU98fS4uoLAtP1Lz8Qa9qnQTywR-oaoiP0pCNt1yy1aWNfGYYdb4x2IJ6djnEoBbMK6JuCX-vZJFgrshlvLHFLNKGxMJrJfd/s1600/circuit-medium.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="574" data-original-width="1020" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4rW2aCtMM3pun5tm6881B8VFxv9HYM7vf3SfHIjj62c_3EU98fS4uoLAtP1Lz8Qa9qnQTywR-oaoiP0pCNt1yy1aWNfGYYdb4x2IJ6djnEoBbMK6JuCX-vZJFgrshlvLHFLNKGxMJrJfd/s320/circuit-medium.jpg" width="320" /></a></h3>
<div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;">
After completing the wiring, you can upload the program in Arduino and test the circuit as explained earlier<br />
<h3 style="text-align: center;">
Control 4 LEDs with Bluetooth</h3>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyrUUUCZY81CjfsMyG9gGTYuWEq8UZd9X4VaD59Uir8CrRGkluIBPJ8O-UBSrShr5uLoj7D7mv5rhcrlXcqeklBKXnleVO8AduVKrSrcKzs7SBzuVa21fgia9-giv0o-sU4mX7VlckYPxa/s1600/title+image.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="338" data-original-width="600" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyrUUUCZY81CjfsMyG9gGTYuWEq8UZd9X4VaD59Uir8CrRGkluIBPJ8O-UBSrShr5uLoj7D7mv5rhcrlXcqeklBKXnleVO8AduVKrSrcKzs7SBzuVa21fgia9-giv0o-sU4mX7VlckYPxa/s320/title+image.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
We controlled one LED with Bluetooth. Now let us control 4 LEDs.<br />
We will need 4 LEDs and 4 resistors of 270 Ohms each.<br />
Let us place all the components on Breadboard<br />
Connect a resistor each between the negative pins of the LEDs and the common rail on breadboard. We are using two separate sections of the breadboard for this circuit, therefore we also need to join the common rails of the two sections later.<br />
Connect a wire between the GND pin of Arduino and the common rail on breadboard.<br />
Connect a wire between the common rail on breadboard and the GND pin of Bluetooth module<br />
Connect a wire between VCC of the Bluetooth module and the 3.3v pin of Arduino<br />
Connect a wire between the TXD pin of the Bluetooth module and the RX pin of Arduino<br />
Connect a wire between the two voltage divider resistors and the RX pin of the Bluetooth module.<br />
Connect a wire between the 1K resistor and the TX pin of Arduno.<br />
We will now connect a wire each to the positive pin of the LED and the digital pins of the Arduino. I have used pin 7, 8, 9, and 10 <br />
Now connect a wire between the two common rails on the breadboard. Now the wiring is complete.<br />
Download the program code, open it in your computer and upload it in Arduino. Download the Code file<a href="https://drive.google.com/open?id=1iZz4sK-dcRUef-K-BKQQ8rqCBEPGG5it" target="_blank"> from this link</a><br />
Now open the App that we had previously installed.<br />
THe LEDs will turn on if you send A, B, C and D. Whereas they will turn off if you send a, b, c, an d. You can also send more than one character and see how the LEDs react to it.</div>
Sanjay Rajurehttp://www.blogger.com/profile/11542442972509970207noreply@blogger.comtag:blogger.com,1999:blog-2679287135209666721.post-16778835340816354252019-05-12T11:22:00.001+05:302019-05-12T11:22:11.916+05:30Code Studio Course C 2018 Lesson 2 # Programming with Angry birdsAfter making a series of videos and articles on Code studio courses two years ago, I noticed that kids are still looking at the videos and visiting the articles as they appear in Google search. I also noticed that they are looking for the newer version of Code Studio courses. The latest version being (2018) as their 2019 version is still in development.<br />
<br />
Not to leave them disappointed when they visit one of my blog articles of Code studio courses, I am making pages for the latest version of these courses. I am starting from Course C (2018) and cover as many courses as are available on Code Org. I hope you will like it as much as you did the previous versions.<br />
<br />
Although it is very easy and self explainatory, for the sake of continuity, I will cover this Lesson too. These images are as big as they can be on my laptop. You can click on the images to view them enlarged if you need to. I welcome if you send me feedback in case you want to say something about this article.<br />
<br />
<h3 style="text-align: center;">
Code Studio Course C 2018 Lesson 2</h3>
<h3 style="text-align: center;">
<b>Programming with Angry birds</b></h3>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<b>Puzzle 2</b></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_mRCH4gKJDcKNljoae3GFFO59nBd2qrVlUkEEDo8eBnW6m2WIbJwFhiWNcpUALeDhUIkcrHID_4doWphcD9IulbVR0pSlsfXjWuzpIStgbP205PS3XeH4-fcBy2FcICaI_ruS6BveOuOu/s1600/CourseC+Lesson2+stage2.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="430" data-original-width="755" height="182" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_mRCH4gKJDcKNljoae3GFFO59nBd2qrVlUkEEDo8eBnW6m2WIbJwFhiWNcpUALeDhUIkcrHID_4doWphcD9IulbVR0pSlsfXjWuzpIStgbP205PS3XeH4-fcBy2FcICaI_ruS6BveOuOu/s320/CourseC+Lesson2+stage2.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Puzzle 2</td></tr>
</tbody></table>
<a name='more'></a><br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiav47AsSqADPxscOUlw-AuOKIYcuNKAFmpbJgR4t55mX7nLTnz61LItdDsdU0Cg-gnC_-FuqVMl94z3BxbSt04ViVOM99lzTDynvITRgEJ03KmHvTnbvH7oa6czGsK4eghEScTpqNzO2bx/s1600/CourseC+Lesson2+stage2+solution.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="138" data-original-width="208" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiav47AsSqADPxscOUlw-AuOKIYcuNKAFmpbJgR4t55mX7nLTnz61LItdDsdU0Cg-gnC_-FuqVMl94z3BxbSt04ViVOM99lzTDynvITRgEJ03KmHvTnbvH7oa6czGsK4eghEScTpqNzO2bx/s1600/CourseC+Lesson2+stage2+solution.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Solution</td></tr>
</tbody></table>
<div style="text-align: center;">
<b>Puzzle 3</b></div>
<div style="text-align: center;">
<b><br /></b></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAVMkoH3j47Hp808lwwBGtxpECo1FTkwv2aXafjQ2FsLhrNYCtmUcUH2aCycVrjRaZSu-wkd4HM7MiYp7J11esrnCXE4bnKeGOmT6fEBb_22EYHXrwqkaAcCqLs-XMHefrtAOV6V8LL8p8/s1600/puzzle3.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="421" data-original-width="748" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAVMkoH3j47Hp808lwwBGtxpECo1FTkwv2aXafjQ2FsLhrNYCtmUcUH2aCycVrjRaZSu-wkd4HM7MiYp7J11esrnCXE4bnKeGOmT6fEBb_22EYHXrwqkaAcCqLs-XMHefrtAOV6V8LL8p8/s320/puzzle3.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Puzzle 3</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9q96n11JZb_QWgndaIBVv2BBQxckTnAb68zsqivOSoJIh7voX0mPaCzHDlq0273lkdmrSzebFjkj4SLdQiW1n74m6S7tD1AAueiWxDbZO73It7Dddkgd0AkPoNGD0Sk7pBaNf_ahiVli0/s1600/puzzle3+answer2.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="164" data-original-width="187" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9q96n11JZb_QWgndaIBVv2BBQxckTnAb68zsqivOSoJIh7voX0mPaCzHDlq0273lkdmrSzebFjkj4SLdQiW1n74m6S7tD1AAueiWxDbZO73It7Dddkgd0AkPoNGD0Sk7pBaNf_ahiVli0/s1600/puzzle3+answer2.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Solution</td></tr>
</tbody></table>
<br /><div style="text-align: center;">
<b>Puzzle 4</b></div>
<div style="text-align: center;">
<b><br /></b></div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzrU8-xzC1PSYdvS98lNOJJUGn9PYp7tRbSJHKKaRG0NtD2-iaIr1zzYG2Sq_e6Ve13om09hekzTv_XBlFUDodwfDnaSK-TAG8yxbPqWUclPzrFYrCHpgDSD1QV6t09KpMaJWYJt9g6Sdi/s1600/puzzle4.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="429" data-original-width="778" height="176" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzrU8-xzC1PSYdvS98lNOJJUGn9PYp7tRbSJHKKaRG0NtD2-iaIr1zzYG2Sq_e6Ve13om09hekzTv_XBlFUDodwfDnaSK-TAG8yxbPqWUclPzrFYrCHpgDSD1QV6t09KpMaJWYJt9g6Sdi/s320/puzzle4.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">puzzle 4</td></tr>
</tbody></table>
<div style="text-align: center;">
<b><br /></b></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-ZJJORtZOdZ3vVCxfwuwhyphenhyphenLjVViPSa5I9faAUn9NZ-brytG2iOF1f_K_CIjhpN9Jd9kMwkVXZGVjXSy-T4M0yPTCbqQcz4RUv-fCe-OydgJlq9dnksdcf9a4bo9N6sltEZy3LcgCBfm8l/s1600/puzzle4+answer.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="192" data-original-width="188" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-ZJJORtZOdZ3vVCxfwuwhyphenhyphenLjVViPSa5I9faAUn9NZ-brytG2iOF1f_K_CIjhpN9Jd9kMwkVXZGVjXSy-T4M0yPTCbqQcz4RUv-fCe-OydgJlq9dnksdcf9a4bo9N6sltEZy3LcgCBfm8l/s1600/puzzle4+answer.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Solution</td></tr>
</tbody></table>
<div style="text-align: center;">
<b><br /></b></div>
<div style="text-align: center;">
<b>Puzzle 5</b></div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5VJgtZPox9PkEUKqEob-dIRmRp_hJtt0l-ELY1yX2LihGMl6LsCqE_EkPt61cK6T1t0YVnXfc57DkEp1GhrF0-Nz1iBEgUR1xr1i0hbwAl5_ouKW0D6wiOHISAX_JEEEthKbAXk_bgFh1/s1600/puzzle5.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="422" data-original-width="727" height="185" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5VJgtZPox9PkEUKqEob-dIRmRp_hJtt0l-ELY1yX2LihGMl6LsCqE_EkPt61cK6T1t0YVnXfc57DkEp1GhrF0-Nz1iBEgUR1xr1i0hbwAl5_ouKW0D6wiOHISAX_JEEEthKbAXk_bgFh1/s320/puzzle5.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">puzzle 5</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi55OvEgxxsY4dQgyOilydSTT34ZceNa_vOa6bGKdeTZrDO9-yT5i1AGh0FTx5BTvBANwOKfpbbjNM31mIT1eoH-Zj0pqnCBuBBHSvw4iT86g7tWK_m2RQ1HdzlDW913I5HE34LRm-VfArw/s1600/puzzle5+answer.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="225" data-original-width="184" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi55OvEgxxsY4dQgyOilydSTT34ZceNa_vOa6bGKdeTZrDO9-yT5i1AGh0FTx5BTvBANwOKfpbbjNM31mIT1eoH-Zj0pqnCBuBBHSvw4iT86g7tWK_m2RQ1HdzlDW913I5HE34LRm-VfArw/s1600/puzzle5+answer.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">solution</td></tr>
</tbody></table>
<div style="text-align: center;">
<b><br /></b></div>
<div style="text-align: center;">
<b>Puzzle 6</b></div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1totsVv9dsBhsXD9lxBFvEPx-hp24AX-wOKIjIlmJm5DzTIfKzmnxHwHGSHhGFsKYVqQ8-rpEHasEE-oB-n8bU9ZusJjORbhul6FvmZ3TSKgLSO3hr4rz5h_aeUeUZRA1L4pyzEsfpU7J/s1600/puzzle5.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="422" data-original-width="727" height="185" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1totsVv9dsBhsXD9lxBFvEPx-hp24AX-wOKIjIlmJm5DzTIfKzmnxHwHGSHhGFsKYVqQ8-rpEHasEE-oB-n8bU9ZusJjORbhul6FvmZ3TSKgLSO3hr4rz5h_aeUeUZRA1L4pyzEsfpU7J/s320/puzzle5.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">puzzle 6</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgS_fyKEor4j3e5D5qoEAyDZ1RzED2rkm3JeTJMg60n4TqrfYw98OLRDxZM-IxnrY0QX7JkRljfzuFn7dA3SJa459AQeFqWnNsPhdLlt1FmZ5fLfLNCEsna3deXU1lw-opCjQAe9QfVfgKC/s1600/puzzle5+answer.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="225" data-original-width="184" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgS_fyKEor4j3e5D5qoEAyDZ1RzED2rkm3JeTJMg60n4TqrfYw98OLRDxZM-IxnrY0QX7JkRljfzuFn7dA3SJa459AQeFqWnNsPhdLlt1FmZ5fLfLNCEsna3deXU1lw-opCjQAe9QfVfgKC/s1600/puzzle5+answer.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">solution</td></tr>
</tbody></table>
<br /><br /><div style="text-align: center;">
<b>Puzzle 7</b></div>
<div style="text-align: center;">
<b><br /></b></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwM1fHVrWQSu-5u8IHzpXjkitde5XBS6KXZJ9M-9CFn2Man2PYAciRrkP18xqkN3t7NWyxoWXnNchtWR6AcgJDypAmO4h9qRiC5csJuEw-3s4NBoXuiU6rQX97YPykOwI6Rn_GAyRKSz2s/s1600/puzzle7.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="425" data-original-width="755" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwM1fHVrWQSu-5u8IHzpXjkitde5XBS6KXZJ9M-9CFn2Man2PYAciRrkP18xqkN3t7NWyxoWXnNchtWR6AcgJDypAmO4h9qRiC5csJuEw-3s4NBoXuiU6rQX97YPykOwI6Rn_GAyRKSz2s/s320/puzzle7.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">puzzle 7</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMtrdYmK68ZmVo2v7wV-TIfjhyPwVHEVo9tUXy5G3EZKJ7tMmgb5cLTqkY2hKKn-l5jrWzNeXF89wOHDrpuGojJjrz_TR3WvY52hKHI1mpP7MIpqisF6xThHTIhtFz-hTqz_ZGczLrLotA/s1600/puzzle7+answer.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="274" data-original-width="219" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMtrdYmK68ZmVo2v7wV-TIfjhyPwVHEVo9tUXy5G3EZKJ7tMmgb5cLTqkY2hKKn-l5jrWzNeXF89wOHDrpuGojJjrz_TR3WvY52hKHI1mpP7MIpqisF6xThHTIhtFz-hTqz_ZGczLrLotA/s1600/puzzle7+answer.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">solution</td></tr>
</tbody></table>
<div style="text-align: center;">
<b><br /></b></div>
<div style="text-align: center;">
<b>Puzzle 8</b></div>
<div style="text-align: center;">
<b><br /></b></div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeeeoD4qVTXRqnXG3Hhs2LLYMPgwFxaSoFan2QfrSeeDEKEHtGS2BYm_dTOiqAiR3fSRxX3MaiHNS0KGmtmeYJXfIoBv1LK8Kd_Vt-5TFUT3MIbO43e1eoA2UmpOitkRiHr5cDvfazZ8gl/s1600/puzzle8.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="543" data-original-width="811" height="214" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeeeoD4qVTXRqnXG3Hhs2LLYMPgwFxaSoFan2QfrSeeDEKEHtGS2BYm_dTOiqAiR3fSRxX3MaiHNS0KGmtmeYJXfIoBv1LK8Kd_Vt-5TFUT3MIbO43e1eoA2UmpOitkRiHr5cDvfazZ8gl/s320/puzzle8.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Puzzle 8</td></tr>
</tbody></table>
<div style="text-align: center;">
<b><br /></b></div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeFTcR2gUS3yMBrlbSKia93ZPj9mVrxqSqcTmJFuQgi-q81Lpvv1j8stf7lRORyLypzue9OkQj7xNk_vrxofErODz1EZKTtU05KT2mXQqI502z7tHtDMLtNeA53LwfhshkWnpMfz8-cTQN/s1600/puzzle8+answer.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="375" data-original-width="217" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeFTcR2gUS3yMBrlbSKia93ZPj9mVrxqSqcTmJFuQgi-q81Lpvv1j8stf7lRORyLypzue9OkQj7xNk_vrxofErODz1EZKTtU05KT2mXQqI502z7tHtDMLtNeA53LwfhshkWnpMfz8-cTQN/s320/puzzle8+answer.jpg" width="185" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Solution</td></tr>
</tbody></table>
<br /><div style="text-align: center;">
<b>Puzzle 9</b></div>
<div style="text-align: center;">
<b><br /></b></div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEih1WLIpQrAiESObCSJA1r2Oxh3nPJxXE2XIgj2qLR81ZWeKyS83mu5XzdvynP7Zy9h4tVyYPBvAmyClW5DOXDP85Ccve1_icjn0luI_Cq2tkim2maLxelfvUpHQgoYtOUoZpN5IoVqThwv/s1600/puzzle9.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="422" data-original-width="768" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEih1WLIpQrAiESObCSJA1r2Oxh3nPJxXE2XIgj2qLR81ZWeKyS83mu5XzdvynP7Zy9h4tVyYPBvAmyClW5DOXDP85Ccve1_icjn0luI_Cq2tkim2maLxelfvUpHQgoYtOUoZpN5IoVqThwv/s320/puzzle9.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Puzzle 9</td></tr>
</tbody></table>
<div style="text-align: center;">
<b><br /></b></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjC2nBJkB49DxbxQsxKvUZekzarwNJVE0-_67-B_bI8THzRCjDM475clBIdQ2wKiPzqupxQSiNJQIH3JtFB34IUJEulzZB7WD5gOCM22szjzCw_6o4PWM62a9Nn59yFUJf68kAq5PU-oMPB/s1600/puzzle9+answer.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="246" data-original-width="212" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjC2nBJkB49DxbxQsxKvUZekzarwNJVE0-_67-B_bI8THzRCjDM475clBIdQ2wKiPzqupxQSiNJQIH3JtFB34IUJEulzZB7WD5gOCM22szjzCw_6o4PWM62a9Nn59yFUJf68kAq5PU-oMPB/s1600/puzzle9+answer.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Solution</td></tr>
</tbody></table>
<br /><div style="text-align: center;">
<b>Puzzle 10</b></div>
<div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
In this puzzle you have to read the displayed code and predict it's outcome. It will show you if you have understood the working of these puzzles. Better that I do not give you the answer for this one.</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<b>Puzzle 11 </b></div>
<div style="text-align: center;">
<b><br /></b></div>
<div style="text-align: left;">
There are several paths you can take to complete this step. You can try and figure out whatever path comes to your mind. Here is one solution, but it is not the only solution. You can come up with your own. </div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgs5blJOUwvs6qmiN-aLao9AyfpwsvH1RGElH7O9ugW-N33kl4bFpP2ajvtD-IBTlH6BCi15Ccsgy65hZvENucvsYLjC5Gem0IKTDc5LzYZO9encz7tVV9vFH4lRfDO6bVHzPunogUIf-ay/s1600/puzzle10.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="416" data-original-width="789" height="168" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgs5blJOUwvs6qmiN-aLao9AyfpwsvH1RGElH7O9ugW-N33kl4bFpP2ajvtD-IBTlH6BCi15Ccsgy65hZvENucvsYLjC5Gem0IKTDc5LzYZO9encz7tVV9vFH4lRfDO6bVHzPunogUIf-ay/s320/puzzle10.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Puzzle 11</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-YgmHpgdhCtVnv_hsgG2mC3Kox4SxTbYu03XL-t0rxEg64R3k-cS7l9uivoAZ8Soq8d_uW0Pc1c-6hEwigL9PyBSOrMjgzxwpOXUOWJ3kimPAcN5dl8mmNAnyoFFB2PJBFuy_y6UQAlOm/s1600/puzzle10+solution.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="328" data-original-width="224" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-YgmHpgdhCtVnv_hsgG2mC3Kox4SxTbYu03XL-t0rxEg64R3k-cS7l9uivoAZ8Soq8d_uW0Pc1c-6hEwigL9PyBSOrMjgzxwpOXUOWJ3kimPAcN5dl8mmNAnyoFFB2PJBFuy_y6UQAlOm/s320/puzzle10+solution.jpg" width="217" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Solution</td></tr>
</tbody></table>
<br /><div style="text-align: left;">
<br /></div>
</div>
Sanjay Rajurehttp://www.blogger.com/profile/11542442972509970207noreply@blogger.comtag:blogger.com,1999:blog-2679287135209666721.post-6295753159999975212019-04-29T22:02:00.003+05:302019-05-12T11:22:56.537+05:30Controlling a 2 Channel Relay with ArduinoHi friends, I am writing this post to reduce the length of the video I am posting on youtube. This article works as a companion of my videos on the same topic.<br />
<br />
In this article let us learn how to use a 2 Channel Opto coupler relay with an Arduino Uno<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnnUTOLGVikng-NDZozpUh8mLt-JZmkRmSKU6_gP2Oq-8u_JU18O_hsxVlpCwN3Z9AGxj7uVO0Big0tafK4iLsdFuDNqJ6b-yqCk85orW1p7S1uMz0Xe3_j-b-7KzWz1BY6QJL1QR7fsQ-/s1600/2channel+relay+with+text.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="600" data-original-width="800" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnnUTOLGVikng-NDZozpUh8mLt-JZmkRmSKU6_gP2Oq-8u_JU18O_hsxVlpCwN3Z9AGxj7uVO0Big0tafK4iLsdFuDNqJ6b-yqCk85orW1p7S1uMz0Xe3_j-b-7KzWz1BY6QJL1QR7fsQ-/s320/2channel+relay+with+text.png" width="320" /></a></div>
<br />
This is a Typical 2 Channel opto coupler relay available on Amazon India. At least that is where I bought one. This is a 5v relay. That means you need to give it a supply of 5v for it to operate. This relay needs supply on two pins.<br />
<a name='more'></a><br />
<br />
The opto coupler has two distinct electric circuits isolated by glass or transparent material. Or coupled optically. That means one circuit makes contact with another circuit only when the Infrared LED on the one side (that is on the GND, IN1, IN2, VCC side) sends a light signal to the light activated transistor, that is part of the JD-VCC - GND side.<br />
<br />
This opto isolation does not complete if the JD-VCC and the VCC are joined by a Jumper, as is the default case when you receive your 2 Channel Relay. This jumper can be used to test the working of the relay and to test if it is working and functional, if you just connect its VCC and GND (of the right hand side of the image) to 5V, and Gnd on the Arduino, and then just connect another port of GND from Arduino to IN1 and then to IN2 briefly. You should notice the LED on the Relay lit and a tick sound of the relay being activated. This happens because this is a Active LOW relay, as are most of the relays that are available for use with Arduino on Amazon India.<br />
<br />
Once you have checked your relay and everything is working fine, then the next step is to remove the jumper from the JD-VCC VCC pins and keep it aside.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRkQBlMKzLz8XdcBGit9en2UVtqyUj3mR_AZGAwf28n0QfGrsAEQIplxN5c17NyKofBP2p_xsCFg8c5o6YXhEjtaHag-AGW53cfKcKk0CAK5VHfPNhvY3D36PXKll8Z15sCS9Gb3wTQlex/s1600/fire.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="876" data-original-width="958" height="182" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRkQBlMKzLz8XdcBGit9en2UVtqyUj3mR_AZGAwf28n0QfGrsAEQIplxN5c17NyKofBP2p_xsCFg8c5o6YXhEjtaHag-AGW53cfKcKk0CAK5VHfPNhvY3D36PXKll8Z15sCS9Gb3wTQlex/s200/fire.png" width="200" /></a></div>
<br />
<br />
Never put the jumper pin over the VCC and GND pins. That is equivalent to inserting a wire, one end in one pin and another in other pin of a electric socket.<br />
<br />
If you put the jumper over the VCC and GND pins ( I think it is a design mistake/ overlook on the part of the designers/ manifacturers to place the pins in close proximity where they are not expected to be used with a jumper. increasing the distance between the VCC pin and the GND pin slightly so that the jumper could not be placed over them could/ or can prevent accidental mishap. If you continue with your experiment while the jumper over the wrong pins, the 20mA current that the 5V pin of the Arduino will pass through the entire circuit while short circuited. It may damage any trace on the PCB either on Arduino or on the Relay. Although I have never attempted it nor have I seen what would actually happen and how much damage it could cause, but it is my learned guess that it may end up ruining your board.<br />
<br />
Take a look at the items that I used in this example.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMD3NYQ5n80H2CJe2u3msSCeUzJsxN6ZJUXYMvueW_iSuHBJvUdfiVPd0UWpeBV54x88NBISUuZuLObyZPwTapoZrLrdnu6n35HU1TbvGj9OOR8rIM_PXfkU_jajLPKC1-utgmgFkiKMDQ/s1600/components.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="450" data-original-width="800" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMD3NYQ5n80H2CJe2u3msSCeUzJsxN6ZJUXYMvueW_iSuHBJvUdfiVPd0UWpeBV54x88NBISUuZuLObyZPwTapoZrLrdnu6n35HU1TbvGj9OOR8rIM_PXfkU_jajLPKC1-utgmgFkiKMDQ/s320/components.png" width="320" /></a></div>
<br />
Arduino board, with a USB cable.<br />
Some Male to female dupont wires. I strongly recommend you to stick to some kind of color code for your convenience. So that you do not insert wires in wrong pins, and it becomes easy for you to check and troubleshoot your circuit in case things are not working the way they are expected to.<br />
An external breadboard power supply will come handy to power the JD-VCC pin of the Relay module.<br />
<br />
I will show you a crude circuit diagram that is easy to understand.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZFSYcVX4WBFxbxFJYDk8HUusLVB2etuStZ2np0jgwJSQmzMvE6t92KqhdoiMdJ3c31exAkBFgK6lKLKVN7oQUSctxNWeA7GPufHnAtW5gU7qpJvsSUX-CzvCpigfi93Khb5r-HI0uUzev/s1600/circuit+diagram+final.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="600" data-original-width="891" height="215" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZFSYcVX4WBFxbxFJYDk8HUusLVB2etuStZ2np0jgwJSQmzMvE6t92KqhdoiMdJ3c31exAkBFgK6lKLKVN7oQUSctxNWeA7GPufHnAtW5gU7qpJvsSUX-CzvCpigfi93Khb5r-HI0uUzev/s320/circuit+diagram+final.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
Connect 5v and Gnd from Arduino to GND and VCC of the Relay ( at the input side)<br />
Connect any pins ( form pin2 to pin13) to the IN1, and IN2 of the relay. ( You will have to define these pin numbers as Relay1 and Relay2 in the program as explained later below)<br />
Then connect the JD-VCC and the adjacent VCC pins to an external DC 5v supply and Ground.<br />
<br />
After that you can connect the 12v adapter to the breadboard power supply , then switch it ON (The breadboard power supply has a On/Off switch on it) . After that connect the USB cable to the Arduino and the computer. Then open the Arduino IDE software and start coding in it.<br />
<br />
Controlling 2 Channel Relay with Arduino Uno<br />
These are the variables that you declare at the beginning of the program. Relay1, Relay2 are variables. And 7 and 8 are the port number or pin numbers on Arduino Uno which we will be using to connect to the IN1 and IN2 of the relay module.<br />
<br />
int Relay1 = 7;<br />
int Relay2 = 8;<br />
<br />
<br />
This is the setup() function of the Arduino. Whatever code you write here will be executed once in the beginning when the program runs. After that only the code in the loop() function will run over and over again till you disconnect the power supply of the Arduino. The program will resume as soon as you power the Arduino again.<br />
<br />
The Serial.begin(9600) function opens the serial port and sets data rate to 9600 bps. We will be opening the Serial communication only if we need to check the output on the connected computer. If you intend to run this program without connecting to the computer, after the program and the circuit are tested. You can reduce the overhead by commenting out all the lines that begin with "Serial."<br />
You do not need Serial () functions to be consuming your processing power if you are not looking at the output on the Serial Monitor a computer.<br />
<br />
There is more to understand here. We will go into it in a later article.<br />
<br />
We declare the pins, that is the Variables Relay1 and Relay2 to be outputs. Then immediately we turn them High. When we turn a pin HIGH using the digitalWrite() function, the LED is turned on if connected with that port, but that is not the case with our relays. We are using Active Low type of relays. And we will turn then Off, to do that we neeed to send HIGH on the port.<br />
<br />
void setup() {<br />
<br />
Serial.begin(9600);<br />
<br />
pinMode(Relay1, OUTPUT);<br />
pinMode(Relay2, OUTPUT);<br />
<br />
digitalWrite(Relay1, HIGH);<br />
digitalWrite(Relay2, HIGH);<br />
}<br />
<br />
<br />
Now we come to the loop() function. Whatever code we write in this function runs over and over again till the Arduino has power. Now we will Turn the Relay On for 1 second one after the other and then turn them off in the reverse order. You can notice the LEDs of the corresponding Relays turned on and the Clicking sound of the Relays as they take their turns.<br />
<br />
void loop() {<br />
<br />
digitalWrite(Relay1, LOW);<br />
Serial.println("Relay 1 On");<br />
delay(1000);<br />
digitalWrite(Relay2, LOW);<br />
Serial.println("Relay 2 On");<br />
delay(1000);<br />
digitalWrite(Relay2, HIGH);<br />
Serial.println("Relay 2 Off");<br />
delay(1000);<br />
digitalWrite(Relay1, HIGH);<br />
Serial.println("Relay 1 Off");<br />
delay(1000);<br />
<br />
}<br />
<br />
In the last experiment, while working with DS3231 RTC, none of the libraries seem to work. I tried all the libraries of ds3231 available, then read all the possible error messages posted on the forums, after that I wondered if the RTC module is faulty or what and I ordered another module and tested with the same results.<br />
<br />
Then I ended up writing to all the authors of the respective ds3231 libraries asking them about my issues. Posted my questions on major forums but could not get any help.<br />
<br />
And guess what in the end, just the Dupont wires that I connected the ds3231 RTC module with the Arduino were somehow loose/ no connection. I found that out when I decided to replace all the cables with a fresh set of cables, and that solved my problem for good.<br />
<br />
This has prompted me to create a section with my videos and articles where I will be posting some common errors and their symptoms so that you can easily detect and rectify the issue. There is one such blooper in this experiment also. I will add a GIF file that I have created here.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiorI3IeE2xSMsdCmPk1ked681jsOcSxDUKCa-4Kwk0FZ3-xSAjYH3sBX57DPuQaaTykczfebWKtNcYTEIARhJB_6GX8CjCHs7GrdzE-tuQmNrUICUycM_lEQuXF74H4zrHS1AAjQLoVxs6/s1600/error+simulation+15+fps.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="224" data-original-width="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiorI3IeE2xSMsdCmPk1ked681jsOcSxDUKCa-4Kwk0FZ3-xSAjYH3sBX57DPuQaaTykczfebWKtNcYTEIARhJB_6GX8CjCHs7GrdzE-tuQmNrUICUycM_lEQuXF74H4zrHS1AAjQLoVxs6/s1600/error+simulation+15+fps.gif" /></a></div>
<br />
<br />
This happens when one of the wires that supply 5v from the external power supply to the relay module is not inserted properly or is faulty. You will see the relay lights turning On and Off as you programmed, and the Serial monitor will display the output of your program, but you will not hear the Click of the Relays. It means the relays are not getting the power they need to make them work. Either try to re-insert the wires or try to replace them with another set of wires and your issue will be resolved.<br />
<br />
<br />
<h3>
<b>Download the code <a href="https://drive.google.com/open?id=1XKog3BP34EeUeg-Pj7odah8Wwk4bkY3S">from this link </a></b></h3>
<br />
<br />Sanjay Rajurehttp://www.blogger.com/profile/11542442972509970207noreply@blogger.comtag:blogger.com,1999:blog-2679287135209666721.post-91260683453054634492018-05-13T19:16:00.000+05:302018-05-13T19:19:42.936+05:30Programming a Tact switch in Arduino with xodHello friends, We will learn how to program a Tact Switch or a Push button in a Arduino project using xod.<br />
The components we will be using for this are<br />
1) Arduino board<br />
2) a Breadboard<br />
3) some wires<br />
4) A Tact Switch<br />
5) A LED<br />
6) Resistors - 220 Ohm, and 10 Kilo Ohm<br />
<a name='more'></a><br />
Let us start with the wiring.<br />
I have a png image of the circuit diagram I have created on Tinkercad. It is a full size image. This image is available<a href="https://drive.google.com/open?id=179KrVXj2cBhrdnkzbhwL-_1o0QSosVh4" rel="nofollow" target="_blank"> on this link</a> for you to download.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://2.bp.blogspot.com/bMSWmPc_xZGu14uD77R-buTZ9NbGNl-2vo9lVrWPPZ7yE0f_FtwamfsGTmt0PaDRRGHTAjUHLwA=s400" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="187" data-original-width="400" height="149" src="https://2.bp.blogspot.com/bMSWmPc_xZGu14uD77R-buTZ9NbGNl-2vo9lVrWPPZ7yE0f_FtwamfsGTmt0PaDRRGHTAjUHLwA=s400" width="320" /></a></div>
<br />
Let us place the Tact switch on the breadboard.<br />
You can place it in only one way, over the ridge along the center of the breadboard.<br />
<br />
Now I will connect one end the 10 Kilo ohms resistor to one end of the switch and other end of the resistor to the negative of the breadboard.<br />
<br />
Place the LED on the breadboard.<br />
<br />
Connect the 220 ohms resistor between negative/smaller pin/cathode of the LED and the negative line of the breadboard.<br />
<br />
Now I will connect a black wire to a Ground pin on Arduino, and a Red wire to 5V pin on Arduino.<br />
<br />
Connect the other end of black wire to the negative of the breadboard, and the other end of the Red wire to the positive of the breadboard.<br />
<br />
We have connected one end of the switch to ground through the resistor.<br />
<br />
Now lconnect other end of the switch to the positive of the breadboard<br />
<br />
Now I will connect a yellow wire to the pin of the switch that is connected with the resistor.<br />
You can connect the other end of this yellow wire to any digital i/o port on Arduino. I am connecting it to port no 10.<br />
Although we don't need the PWM functionality here.<br />
<br />
I am connecting a white wire to the longer pin of the LED/ the Anode, and other end of the wire to the Pin no 11 on Arduino.<br />
Now let us power this circuit.<br />
<br />
I have already uploaded the program in it.<br />
<br />
The LED turns on immediately.<br />
<br />
It normally stays on, until we press the switch and as long as we keep it pressed.<br />
<br />
That is how the Tact switches function<br />
<br />
Now let us make some changes in the circuit to make the LED stay normally off.<br />
<br />
This image is available <a href="https://drive.google.com/open?id=1fkEl9weSXEGePqDxlxCzaAgxw8Tjkxcg" rel="nofollow" target="_blank">on this link</a> for you to download.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/FeK0Hltjz_0kXgnsgSrYGpBSgf80XMrQzOA3J5arjBSqBIVQ1fexUG3z86Og3LRDUbRj4cJ6OKc=s400" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="187" data-original-width="400" height="149" src="https://4.bp.blogspot.com/FeK0Hltjz_0kXgnsgSrYGpBSgf80XMrQzOA3J5arjBSqBIVQ1fexUG3z86Og3LRDUbRj4cJ6OKc=s400" width="320" /></a></div>
<br />
<br />
The only change that we will make here is to move the resistor connected between the switch and the ground to switch and the positive line instead and then ground the other pin of the switch. That's all.<br />
<br />
When we power this circuit, the LED is off, and it remains off until we press the button, and as long as we keep the button pressed, it stays on.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgusKAixyxDH30lk5sULuhUwH-RrDN3yfW9H2J2EwxSrCQReBnbWCPEAuQ3HKxLsLgMvEdtzL-ugH5LNPypgWASOdA7plgN3fx86a1i3fkXumRKS1NpCAGzeDYuZT8AJgDCg9RckXI15aq1/s1600/xod-screen.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="268" data-original-width="250" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgusKAixyxDH30lk5sULuhUwH-RrDN3yfW9H2J2EwxSrCQReBnbWCPEAuQ3HKxLsLgMvEdtzL-ugH5LNPypgWASOdA7plgN3fx86a1i3fkXumRKS1NpCAGzeDYuZT8AJgDCg9RckXI15aq1/s1600/xod-screen.png" /></a><br />
So these are the two circuits that we can run with a single program from the xod.<br />
<br />
Now let us see how to create this program in xod.<br />
<br />
open the xod program. Press i. search for "button", select the button, drag it on the screen elsewhere.<br />
<br />
now search for and select "led"<br />
<br />
position the LED box below the button box.<br />
<br />
Select "button", type 10 in front of the port value<br />
<br />
Select "LED", type 11 in front of the port value<br />
<br />
Now create a link between PRS from the button and LUM of the led.<br />
<br />
That's it. That is all there is in this program. upload this program on Arduino and test it with the two circuits we just built.<br />
<div>
<br /></div>
Sanjay Rajurehttp://www.blogger.com/profile/11542442972509970207noreply@blogger.comtag:blogger.com,1999:blog-2679287135209666721.post-75141413292235500402018-03-22T10:14:00.001+05:302018-03-22T10:14:09.756+05:30Kodu Game Lab Tutorials<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKxntCOIn8swCqHgwZY8svq7bZB981qPjZoj7uRA20-RXMH_goSiEIa4ozogR3yuhfrh-GBpxQ8CiNVranKbJPCfGKPfMgOIO9oZrEZJKMjguq3OJmct3jjn5xyjLIWZ_lIUEjoDkjbEmo/s1600/ThumbEnglish0.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="900" data-original-width="1600" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKxntCOIn8swCqHgwZY8svq7bZB981qPjZoj7uRA20-RXMH_goSiEIa4ozogR3yuhfrh-GBpxQ8CiNVranKbJPCfGKPfMgOIO9oZrEZJKMjguq3OJmct3jjn5xyjLIWZ_lIUEjoDkjbEmo/s320/ThumbEnglish0.png" width="320" /></a></div>
<br />
Kodu Game Lab is a free 3D games building software that uses blocks based programming similar to Scratch programming.<br />
<br />
I will be making a series of introductory video Tutorials to help you get started with Kodu programming. I am making available the .kodu2 files of each tutorials form the link below. It is a zip file. Download it and extract anywhere. It will include all the Kodu2 files of the Tutorials I have made so far. If you already have Kodu Game Lab installed on your computer you can simply double click on the kodu2 file and start playing it.<br />
<br />
If you do not have installed Kodu Game lab yet. You can get it from this link below<br />
<a href="https://www.kodugamelab.com/" rel="nofollow" target="_blank">https://www.kodugamelab.com/ </a><br />
<br />
You can get the zip file of my Tutorials<a href="https://drive.google.com/drive/folders/1ApqLaJP3lYH6IT-LafLRQel4MgZse1t9?usp=sharing" rel="nofollow" target="_blank"> from this link </a><br />
<br />
<br />Sanjay Rajurehttp://www.blogger.com/profile/11542442972509970207noreply@blogger.comtag:blogger.com,1999:blog-2679287135209666721.post-29447768047838940072018-03-15T16:13:00.001+05:302018-03-16T11:42:53.333+05:30Alice3 3D models Animations programming TutorialsI am creating a series of video tutorials on Alice3 on Youtube. Alice3 is a free underappreciated free software from Carnegie Mellon University. It comes with Sims built in. Where you can create your own 3D Avatars and animate them and create Youtube videos with them.<br />
<br />
I have made available all the Tutorial files along with these videos. I will give a link to download them from my Google Drive. It is a compressed Zip file containing all the a3p files of the Alice 3 tutorials.<br />
<br />
<a href="https://drive.google.com/drive/folders/1h9ABUaEZOVqzl_AOmKbiYTqmOTWgGfhs?usp=sharing" rel="nofollow" target="_blank">Alice3 Tutorials Download</a><br />
<br />
If you haven't installed Alice 3 on your computer then you can do it from the link below<br />
<br />
<a href="http://www.alice.org/get-alice/alice-3/" target="_blank">http://www.alice.org/get-alice/alice-3/</a><br />
<br />
You need to uncompress and copy all the a3p files in this folder below<br />
<br />
Documents - Alice 3 - MyProjects<br />
<br />
Try not to create any sub folder under MyProjects so that the Alice3 program can detect and display the files at the opening dialog screen.Sanjay Rajurehttp://www.blogger.com/profile/11542442972509970207noreply@blogger.comtag:blogger.com,1999:blog-2679287135209666721.post-29679028463159154132018-01-18T10:47:00.000+05:302018-01-18T10:50:40.309+05:30Learn Python Easy Way - Print and FormatLet us look at some of the ways of using the print statement/function in Python.<br />
<br />
print("amazon","Echo")<br />
<span style="color: blue;">amazon Echo</span><br />
<br />
<a name='more'></a>print("amazon","echo", sep="")<br />
<span style="color: blue;">amazonecho</span><br />
<br />
print("amazon","echo", sep=".")<br />
<span style="color: blue;">amazon.echo</span><br />
<br />
print("amazon","echo", sep="-")<br />
<span style="color: blue;">amazon-echo </span><br />
<span style="color: blue;"><br /></span>
The sep is a parameter in the Print function. It is the Separator. You can specify anything as a separator here. If you just type "" or '' Quotes without a space between, then there will be no space between the words in the print function. I have demonstrated it above by making use of different special characters such as a dot, and a dash.<br />
<br />
Incidentally you always have to type print in small letters. If you capitalize the P, it will result in error.<br />
<br />
I have used Double Quotes in the Print function, you can also use single Quotes if you prefer it.<br />
<br />
<br />
<b>Escaping Quotes</b><br />
<br />
You can use / a backward slash for escaping quotes. This can be helpful when you want to write a Apostrophe in the print statement. However you do not need escape character for printing double quotes.<br />
<br />
print('It\'s obvious')<br />
<span style="color: blue;">It's obvious</span><br />
<br />
Format function<br />
<div>
<br /></div>
<div>
Now let us look at some of the ways the format function can be used inside print function</div>
<div>
<br /></div>
<div>
print("You can buy {} for {} Rupees per Kg" .format('Onions', 30))</div>
<div>
<span style="color: blue;">You can buy Onions for 30 Rupees per Kg</span></div>
<br />
<br />
This is an example of the format function. It makes use of the placeholders {}, you can add specifiers inside the {} that we sill see in further examples. You would write the text to be displayed in the print statement within Quotes, and add {} wherever needed. After the Quotes, you will write .format and write the arguments inside brackets. It can be text, numbers or even mathematical formula in it. An empty parenthesis would carry the sequence of the arguments in the .format(), whereas you can specify the sequence in the {} that we will see in other examples.<br />
<br />
Moreover the arguments in the format() can include variables too.<br />
<br />
<b><br /></b>
<b>Positional Index in the placeholders</b><br />
<br />
print('This Train will start from {0} and stop at {1}' .format('Varanasi','Pune'))<br />
<span style="color: blue;">This Train will start from Varanasi and stop at Pune</span><br />
<br />
print('This Train will start from {1} and stop at {0}' .format('Varanasi','Pune'))<br />
<span style="color: blue;">This Train will start from Pune and stop at Varanasi</span><br />
<span style="color: blue;"><br /></span>
<span style="color: blue;"><br /></span>
<b></b><br />
<div>
<b><b><br /></b></b></div>
<b>
Date and Time format</b><br />
<br />
This is one of the important information we might need to print in out Python programs. Let us see the formatting of Date/Time. We need to use the module datetime for this<br />
<div>
<br /></div>
<div>
from datetime import datetime<br />
print('The Train will start on {:%Y-%m-%d %H:%M}'.format(datetime(2018, 1, 17, 10, 20)))</div>
<div>
<span style="color: blue;">The Train will start on 2018-01-17 10:20</span><br />
<div>
<span style="color: blue;"><br /></span>
<br />
<br />
<br />
<br /></div>
</div>
Sanjay Rajurehttp://www.blogger.com/profile/11542442972509970207noreply@blogger.comtag:blogger.com,1999:blog-2679287135209666721.post-15539557284880998422018-01-12T12:41:00.001+05:302018-01-12T12:42:38.291+05:30For and While Loops in Python Examples 1<b>Below is the first example program of Loops</b><br />
<br />
# This program asks user to input a integer number<br />
# It sums all the integers from 1 to the user input<br />
# The for loop runs the same program several times<br />
<br />
<a name='more'></a># for Loop<br />
for m in range(0,3):<br />
<br />
# User input<br />
x = int(input("Input a number : "))<br />
<br />
# Variables<br />
sum = 0<br />
counter = 1<br />
<br />
# while Loop<br />
while counter <= x :<br />
sum = sum + counter<br />
counter = counter + 1<br />
<br />
# Print is outside of while loop but inside for Loop<br />
print("Sum of all numbers from 1 to %d is : %d" % (x,sum))<br />
<br />
<a href="https://docs.google.com/document/d/1f2keu_F51V-A9MX3a46K43u2tBWBvgoTF_RaSfrUN8U/edit?usp=sharing" rel="nofollow" target="_blank">Link to program Code</a><br />
<br />
<b>Below is the Second example program of Loops</b><br />
<br />
# This program generates a random number between 0 to 20<br />
# It aks user guess the number<br />
# It allows the user 5 attempts<br />
# Every incorrect attempt is alerted by a message<br />
# Hinting if the answer is a bigger or a smaller<br />
<br />
# import random module<br />
import random<br />
<br />
# randint function<br />
x = random.randint(0,20)<br />
<br />
# variables<br />
guess = 0<br />
attempts = 0<br />
<br />
# loop<br />
while(attempts < 5):<br />
# waiting for User input <br />
guess = int(input("Enter your guess (from 0 to 20): "))<br />
<br />
if guess > x:<br />
print("You entered a bigger number")<br />
elif guess < x:<br />
print("You entered a smaller number")<br />
elif guess == x:<br />
print("That's a right answer!")<br />
break<br />
# loop increment <br />
attempts = attempts + 1<br />
# End of while loop<br />
else:<br />
print("\nYou have exhausted 5 attempts, Better luck next time !!!")<br />
<div>
<br /></div>
<br />
<a href="https://docs.google.com/document/d/18WqhO4iZiBbfP5vrcf5SqEZtTSjG1gF9f4GGjlyMe7E/edit?usp=sharing" target="_blank">Link to Program 2 Code</a><br />
Sanjay Rajurehttp://www.blogger.com/profile/11542442972509970207noreply@blogger.comtag:blogger.com,1999:blog-2679287135209666721.post-56462159139614905032018-01-05T10:02:00.002+05:302018-01-08T06:26:42.149+05:30Learn Python Easy way - User InputLet us learn how user input is received in Python<br />
<br />
Let us do the most basic exercise<br />
<br />
x = input()<br />
<span style="color: blue;">3</span><br />
print(x)<br />
<span style="color: blue;">3</span><br />
<br />
<a name='more'></a><br />
<br />
When we assign a variable to the function input() that is enough for Python to wait for the user input and collect any input and store it in that variable.<br />
<br />
This works well in a Python Shell, but we will be at a loss if we run this as part of a Pytho script, because we will not understand what the Python script is expecting from us. Therefore we need to add some explainatory text for the user to understand what he is supposed to do.<br />
<br />
x = input("input any number : ")<br />
input any number : 44<br />
print("The number you entered is: " +x)<br />
The number you entered is: 44<br />
<br />
Now we will try to add the numbers received from the user<br />
<br />
a = input("Enter any number: ")<br />
b = input("Enter another number: ")<br />
print("The sum of the numbers you have entered is: " , a+b)<br />
<br />
The Shell interaction produces following result<br />
<br />
a = (input("<span style="color: lime;">Enter any number</span>: "))<br />
<span style="color: blue;">Enter any number:</span> 44<br />
b = (input("<span style="color: lime;">Enter another number:</span> "))<br />
<span style="color: blue;">Enter another number</span>: 67<br />
print(<span style="color: lime;">"The sum of the numbers you have entered is: "</span> , a+b)<br />
<span style="color: blue;">The sum of the numbers you have entered is: 4467</span><br />
<span style="color: blue;"><br /></span>
<span style="color: blue;">Notice that the sum of 44 and 67 is displayed as 4467, obviously Python is treating these numbers as text string. To let Python Know that we intend to expect integer numbers from the user, append int to the lines</span><br />
<span style="color: blue;"><br /></span>
a = int (input("Enter any number: "))<br />
b = int (input("Enter another number: "))<br />
<br />
print("The sum of the numbers you have entered is: " , a+b)<br />
<br />
Now we can expect correct output<br />
<br />
<span style="color: blue;">The sum of the numbers you have entered is: 111</span><br />
<br />
So far so good, we could do this in the Python Shell. How about creating a Python script file and running that script in the Python Shell?<br />
<br />
Save the following code anywhere on your desktop as .py file, and then open it from within the Python Shell, and then click on Run - Run Module (or press F5)<br />
<br />
name = input("Enter your name : ")<br />
age = input("Enter your age : ")<br />
print("Hello " + name + ", so you are " + age + " years old<br />
<br />
You will see this interaction in your Python shell<br />
<br />
Enter your name : Ishan<br />
Enter your age : 9<br />
<span style="color: blue;">Hello Ishan, so you are 9 years old !</span>Sanjay Rajurehttp://www.blogger.com/profile/11542442972509970207noreply@blogger.comtag:blogger.com,1999:blog-2679287135209666721.post-39994019525632248712018-01-04T06:55:00.000+05:302018-01-04T06:55:56.607+05:30Learn Python Easy Way - SetsLet us learn what a set is in Python. We use the term set in our language for example when I say, "I have a set of colours" that means I have a set of some colours that are unique, all different colors. Usually "a set" would denote a unique set of items, and that is how it is implemented in Python. The set in Python is used similar to the "Set Theory" in Mathematics. We can do operations like Union, Intersection, Difference on sets in Python.<br />
<a name='more'></a><br />
<br />
We have learnt about Strings, Lists, Tuples and Dictionaries. We enclose Lists in [ ] Square brackets, Tuples in ( ) normal brackets, and dictionaries in { } Curly brackets.<br />
<br />
The Sets in Python are enclosed in { } Curly brackets too. The difference in dictionaries and sets is that a dictionary is in key:value pair, whereas a Set is like a list of unique items.<br />
<br />
The Sets can be created by using set([ ]) notation. This notation is useful if you want to create frozensets.<br />
<br />
One more thing about lists is that even if you type duplicate elements in a Set it will automaticlly be discarded.<br />
<br />
Let us create a Set using { } Curly brackets<br />
<br />
fruits = {"Apples","Bananas","Lemons","Pineapples","Watermelons","Grapes","Pears","Dates","Pomegranates"}<br />
<br />
This is a Set of names of different fruits. I have used "" double quotes for strings, you can use single quotes instead if you like.<br />
<br />
Now let us create a set of names of dry fruits<br />
dry_fruits = {"Almonds","Cashews","Dates"}<br />
<br />
And a set of Citrus fruits<br />
citrus_fruits = {"Lemons","Pineapples"}<br />
<br />
If you know how Sets in Mathematics are handled, the same principles are applied here. The idea of a Superset and a subset is also applied here<br />
<br />
We can determine if a given set is a subset of another with issubset() function<br />
<br />
dry_fruits.issubset(fruits)<br />
<br />
This will check if the set dry_fruits is a proper subset of fruits or not. If all the items in dry_fruits are present in the set fruits then it will return True, or it will say False<br />
<br />
Here in our case we see False returned, because the items "Cashews" and "Almonds" are not present in the set fruits.<br />
<br />
Now Let us check the other list<br />
<br />
citrus_fruits.issubset(fruits)<br />
<br />
This will return True as all the elements of citrus_fruits are present in the set fruits as well.<br />
<br />
We can add things to a list after it has been created.<br />
<br />
fruits.add("Guava")<br />
<br />
Will add a new name "Guava" in the fruits set<br />
<br />
Another set operation is difference, we can find out the unique elements in the first set that are not present in the other set<br />
<br />
dry_fruits.difference(fruits)<br />
{'Almonds', 'Cashews'}<br />
<br />
fruits.difference(dry_fruits)<br />
{'Apples', 'Pears', 'Bananas', 'Watermelons', 'Pomegranates', 'Grapes', 'Pineapples', 'Lemons'}<br />
<br />
We can also do this operation with more than one sets<br />
<br />
fruits.difference(dry_fruits).difference(citrus_fruits)<br />
<br />
Will display only the items from fruits that are not present in either dry_fruits and citrus_fruits<br />
<br />
<br />
There is a function called difference_update<br />
<br />
fruits.difference_update(dry_fruits)<br />
<br />
That will remove all the items that are common to both the sets from the fruits set<br />
<br />
We can use the Union operator on sets too, it is non destructive operation, does not make any changes to the sets themselves<br />
<br />
fruits.union(dry_fruits)<br />
or<br />
fruits | dry_fruits<br />
<br />
There is function called intersection, it will display only those elements that are present in both the sets<br />
<br />
x = {5, 3, 4, 2, 6}<br />
y = {5, 1, 11, 9, 2}<br />
<br />
x.intersection(y) wil return<br />
{2, 5}<br />
<br />
<br />
So we can run functions that change the items in the sets as well as there are functions that operate without making any changes.<br />
<br />
What if we do not want any changes to happen in our sets. Could we do that? The answer is Yes, we can create a Set such that it can not be altered later on. It is called frozen set<br />
<br />
You could create a set using this notation<br />
<br />
weekdays = set(["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"])<br />
<br />
Now let us create a frozen set<br />
<br />
weekdays = frozenset(["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"])<br />
<br />
Now try to remove an element from the frozen set<br />
<br />
weekdays.remove("Monday")<br />
<br />
you will see an error<br />
AttributeError: 'frozenset' object has no attribute 'remove'<br />
<br />
So that is how we can make our sets write protected. We can read them like normal sets.<br />
<br />
<br />
<br />Sanjay Rajurehttp://www.blogger.com/profile/11542442972509970207noreply@blogger.comtag:blogger.com,1999:blog-2679287135209666721.post-57730807586167051442017-12-28T18:02:00.000+05:302017-12-28T18:04:16.592+05:30Learn Python Easy Way - TuplesLet us understand Tuples in Python. We had learnt Lists in Python in the previous article. Tuples can be understood in comparison to the Lists.<br />
<br />
We created Lists. Lists were a set of objects enclosed in [ ] square braces. Tuples are also a set of objects but they are enclosed in ( ) brackets.<br />
<br />
<a name='more'></a>Both the data types are indexed. The elements can be accessed by their index numbers.<br />
<br />
A Tuple can be understood as a finalized list. When we create a list, it can be appended, sorted, it's elements can be deleted, and new one's inserted etc. You can easily find out the number of operations that can be done on a list in your Python Shell<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiySQ_Wt844l9pbSf5UVIkTvj26sTP5dVUw7WTw76Y3zDHF7EybHbRmV5Y117UWEf7ay4jG_L5FNlG4tLMqeo6j7N3kc05z27hyphenhyphen7lrTeLR_NNJ9tT-lK3UZQJfyqRtzzR-dJkvVSzN7bxGO/s1600/menu1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="247" data-original-width="327" height="241" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiySQ_Wt844l9pbSf5UVIkTvj26sTP5dVUw7WTw76Y3zDHF7EybHbRmV5Y117UWEf7ay4jG_L5FNlG4tLMqeo6j7N3kc05z27hyphenhyphen7lrTeLR_NNJ9tT-lK3UZQJfyqRtzzR-dJkvVSzN7bxGO/s320/menu1.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Whereas in a Tuple with similar elements, you can not insert, append or delete elements in a Tuple. Therefore I will term a Tuple as a finalized list that does not need to be altered. You can find out the operations that can be done on a Tuple in your Python Shell</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxM2lfkOz-toMbZx-NSe-8JKw7gBR_vmMO45f9PWZVoS2JWq4DgkcuZZNgd9yFjFr7EXODwkfHN5ND-5JIgeVLXNWQmzo7q-tj5pJAfDGKSzwCPAuMKy-hRc20VzOqvx2EQtrZ6VAyNGO3/s1600/menu2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="156" data-original-width="329" height="151" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxM2lfkOz-toMbZx-NSe-8JKw7gBR_vmMO45f9PWZVoS2JWq4DgkcuZZNgd9yFjFr7EXODwkfHN5ND-5JIgeVLXNWQmzo7q-tj5pJAfDGKSzwCPAuMKy-hRc20VzOqvx2EQtrZ6VAyNGO3/s320/menu2.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
You can display the elements of a List and a Tuple in the same way. You can view them full or slice them. You can even add two tuples using + operator. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Therefore Tuples are lists that are enclosed in ( ) brackets. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
We can use both, Lists and Tuples in a dictionary. Incidentally Lists, Tuples and Dictionaries all three are termed as data types in Python. </div>
Sanjay Rajurehttp://www.blogger.com/profile/11542442972509970207noreply@blogger.comtag:blogger.com,1999:blog-2679287135209666721.post-10126668492342317192017-12-26T07:21:00.000+05:302017-12-26T07:21:05.723+05:30Learn Python Easy way - DictionariesLet us see what is a dictionary in Python. Creating a dictionary is like creating a List, a list of coupled objects, pair of objects. A list is an ordered set of objects, and a dictionary is un-ordered set of objects<br />
<br />
Objects in a list can be accessed by their index numbers but objects in a dictionary can't. Each object in a dictionary has a Key and a Value. We need to use the key to access it's value. A key woks like the index number. But a key is not necessarily a number. It can be any data type.<br />
<br />
<a name='more'></a><br />
<br />
Let us understand a dictionary by an example.<br />
<br />
This is a table of names of most populated cities in india with the number of it's inhabitants according to the last census.<br />
<br />
Mumbai 12,442,373<br />
Delhi 11,034,555<br />
Bangalore 8,443,675<br />
Hyderabad 6,993,262<br />
Ahmedabad 5,577,940<br />
Chennai 4,646,732<br />
<br />
Let us create a dictionary using Python, so that we will then be able to type in the name of the city to find out the number of people living in it. A dictionary is enclosed by curly braces {}<br />
<br />
I will give a short name to this dictionary "city" for ease of use<br />
<br />
city = {"Mumbai":12442373, "Delhi":11034555, "Bangalore":8443675, "Hyderabad":6993262, "Ahmedabad":5577940}<br />
<br />
This is a dictionary. The name of the dictionary is city. All the elements of this dictionary are within {} curly braces. Each object in the dictionary is separated by a , comma. Each element consists of a key and a value.<br />
<br />
"Mumbai":12442373<br />
<br />
We are using a text string "Mumbai" as a key here. A : Colon follows a key and the next comes the Value. We have a number as a value. Keys and values can have any data type. Thus we can see, we can create any type of table. A digital table which we can then query.<br />
<br />
city["Mumbai"]<br />
<span style="color: blue;">12442373</span><br />
<span style="color: blue;"><br /></span>
city["Bangalore"]<span style="color: blue;">8443675</span><br />
<span style="color: blue;"><br /></span>
But we will get a Error message if we try to access a name not in there<span style="color: blue;"></span><br />
<br />
<div>
city["Kolkata"]..<span style="color: red;">.KeyError: 'Kolkata'</span><br />
<br />
We can access all the elements in a dictionary by simply typing it's name in a Python shell<br />
<br />
city<br />
<span style="color: blue;">{'Mumbai': 12442373, 'Delhi': 11034555, 'Bangalore': 8443675, 'Hyderabad': 6993262, 'Ahmedabad': 5577940}</span><br />
<br />
<br />
Let us see what are the operations that we can perform on a dictionary<span style="color: blue;"><br /></span>
Say, we want to add a new city name in it along with it's population. How do we do that ? It is shown below.<br />
<span style="color: blue;"><br /></span>
<span style="color: blue;"></span><br />
city["Chennai"] = 4646732<br />
Let us substantiate that by printing the entire dicionary<br />
<br />
city<br />
<span style="color: blue;">{'Mumbai': 12442373, 'Delhi': 11034555, 'Bangalore': 8443675, 'Hyderabad': 6993262, 'Ahmedabad': 5577940, 'Chennai': 4646732}</span><br />
<br />
How about changing the value of population of a city ? We can do that too<br />
<br />
city["Mumbai"] = 12500000<br />
<br />
And confirm it by<br />
<br />
city["Mumbai"]<br />
<span style="color: blue;">12500000</span><br />
<br />
What if we decide to delete a city in the dictionary, could we do that ? Yes we can.<br />
<br />
del city["Ahmedabad"]<br />
<br />
We can confirm that by using just the city["Ahmedabad"] which will display a keyError, or we can see the entire dicionary. As our dictionary is short, we can print it here<br />
<br />
city<br />
<span style="color: blue;">{'Mumbai': 12500000, 'Delhi': 11034555, 'Bangalore': 8443675, 'Hyderabad': 6993262, 'Chennai': 4646732}</span><br />
<br />
Notice that Ahmedabad is missing in there!<br />
<br />
Now let us take another example where a Key is a number and the Value is a Text string. We might sometime need such a table<br />
<br />
mydict = {1:"Sanjay", 2:"Chandrakant", 3:"Shailaja"}<br />
<br />
mydict<br />
<span style="color: blue;">{1: 'Sanjay', 2: 'Chandrakant', 3: 'Shailaja'}</span><br />
<br />
mydict[1]<br />
<span style="color: blue;">'Sanjay'</span><br />
<br />
mydict[2]<br />
<span style="color: blue;">'Chandrakant'</span><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br /></div>
Sanjay Rajurehttp://www.blogger.com/profile/11542442972509970207noreply@blogger.comtag:blogger.com,1999:blog-2679287135209666721.post-56214730649249161142017-12-20T18:51:00.000+05:302017-12-21T17:30:28.909+05:30Learn Python Easy Way Part 6 Copy ListsToday lets is see how to copy a list. That means we can copy an entire list or a part of it as a separate list. But it has interesting features to it.<br />
<br />
Let us create a list of names of cities<br />
<br />
Cities = ['Mumbai', 'Pune', 'Nagpur']<br />
<br />
<br />
<a name='more'></a>Now I will copy this list to another. All I have to do is to use the assign operator and the name/s of the lists<br />
<b><br /></b>
<br />
<h3>
<b>Shallow Copy</b></h3>
<br />
Cities2 = Cities<br />
<br />
This method is perhaps called as Shallow Copy. In this method the contents of the list Cities are referred to by a new variable Cities2. It is in fact the same list referred to by two different names.<br />
<br />
This is all I have to do to create a copy of the list named Cities. We can verify it. Run the following code in a Python Shell<br />
<br />
print(Cities)<br />
<span style="color: blue;">['Mumbai', 'Pune', 'Nagpur']</span><br />
<br />
print(Cities2)<br />
<span style="color: blue;">['Mumbai', 'Pune', 'Nagpur']</span><br />
<span style="color: blue;"><br /></span>
Now the fun part, we will change something in the copy of our first list and see what happens. We will add another item in the list Cities2<br />
<div>
<br /></div>
<div>
Cities2.append('Kolkata')</div>
<div>
<br /></div>
<div>
Now let us print the content of our appended list Cities2</div>
<div>
<br /></div>
<div>
print(Cities2)</div>
<div>
<span style="color: blue;">['Mumbai', 'Pune', 'Nagpur', 'Kolkata']</span></div>
<div>
<br /></div>
<div>
As we have only changed the copy and not have made any changes to the original, we would expect that the original list should be unaffected. Let us find that out. Let us print the contents of the original list.</div>
<div>
<br /></div>
<div>
print(Cities)</div>
<div>
<span style="color: blue;">['Mumbai', 'Pune', 'Nagpur', 'Kolkata']</span></div>
<div>
<span style="color: blue;"><br /></span></div>
Notice the list, it has also changed. It seems that the two list names are dynamically linked together, if you make changes to one list, the other reflects those changes too. Let us try it on the first list and see what happens.<br />
<div>
<br /></div>
<div>
Cities.insert(3,'Singapore')</div>
<div>
print(Cities)</div>
<div>
<span style="color: blue;">['Mumbai', 'Pune', 'Nagpur', 'Singapore', 'Kolkata']</span></div>
<div>
<br /></div>
<div>
<div>
Let us check what has happened to the copy list Cities2</div>
<div>
<br /></div>
<div>
print(Cities2)</div>
<div>
<span style="color: blue;">['Mumbai', 'Pune', 'Nagpur', 'Singapore', 'Kolkata']</span></div>
<div>
<br /></div>
<div>
<br />
Right, it has also changed. That is because we are looking at the same list by two different names.<br />
<br />
<h3>
Copy with Slice [:]</h3>
</div>
</div>
<div>
<br /></div>
<div>
But of course that is not the only way to create a copy of a list in Python. We can also create a copy of list, entire list or a part of it by using Slice. Let us see how that works</div>
<div>
<br /></div>
<div>
Let me first create a new list</div>
<div>
<br /></div>
<div>
<div>
Cities = ['Mumbai','Bangalore','Delhi','Kolkata']</div>
<div>
<br /></div>
<div>
Now I will try to copy the entire list using [:] symbol</div>
<div>
Cities2 = Cities[:]</div>
<div>
<br /></div>
<div>
When we print the contents of Cities2, it is confirmed</div>
<div>
print(Cities2)</div>
<div>
['Mumbai', 'Bangalore', 'Delhi', 'Kolkata']</div>
<div>
<br /></div>
<div>
Now let us remove one name from the copied list</div>
<div>
Cities2.remove('Mumbai')</div>
<div>
print(Cities2)</div>
<div>
['Bangalore', 'Delhi', 'Kolkata']</div>
<div>
<br /></div>
<div>
Now let us check if that has changed anything in our original list</div>
<div>
print(Cities)</div>
<div>
['Mumbai', 'Bangalore', 'Delhi', 'Kolkata']</div>
<div>
<br /></div>
<div>
No it hasn't. Now lst us change something in the original list and see if that affects the copied list</div>
<div>
<br /></div>
<div>
Cities.append("Rangoon")</div>
<div>
print(Cities)</div>
<div>
['Mumbai', 'Bangalore', 'Delhi', 'Kolkata', 'Rangoon']</div>
<div>
print(Cities2)</div>
<div>
['Bangalore', 'Delhi', 'Kolkata']</div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
As you can see, by making a copy of a list by using the Slicing method, you can copy the entire list. This way we get two independent lists which are unaffected by changes made to the other.<br />
<br />
But Slice is not a method designed for copying Lists. Slice has its own uses. Therefore there must be another dedicated method for copying lists. And there is one. It is called deepcopy.<br />
<br />
<h3>
deepcopy</h3>
</div>
<div>
When we use assignment operator, the copy that is made is not really a copy, it just assigns a new name to the existing list. So we access the same list by two different names. But if we want to make a real copy, use deepcopy</div>
<div>
<br /></div>
<div>
from copy import deepcopy</div>
<div>
<br /></div>
<div>
We need to write the above sentence in the code/Python shell to use deepcopy method. Now we will test if the method works as promised</div>
<div>
<br /></div>
<div>
cities = ['Mumbai','Pune',['Vadnagar','Surat','Jamnagar'], 'Delhi']</div>
<div>
cities2 = deepcopy(cities)</div>
<div>
<div>
print(cities)</div>
<div>
<span style="color: blue;">['Mumbai', 'Pune', ['Vadnagar', 'Surat', 'Jamnagar'], 'Delhi']</span></div>
</div>
<div>
<div>
print(cities2)</div>
<div>
<span style="color: blue;">['Mumbai', 'Pune', ['Vadnagar', 'Surat', 'Jamnagar'], 'Delhi']</span></div>
</div>
<div>
<br /></div>
<div>
cities2.insert(2,'Gujarat')</div>
<div>
<div>
print(cities2)</div>
<div>
<span style="color: blue;">['Mumbai', 'Pune', 'Gujarat', ['Vadnagar', 'Surat', 'Jamnagar'], 'Delhi']</span></div>
</div>
<div>
<div>
print(cities)</div>
<div>
<span style="color: blue;">['Mumbai', 'Pune', ['Vadnagar', 'Surat', 'Jamnagar'], 'Delhi']</span></div>
</div>
<div>
<br /></div>
<div>
cities.remove(['Vadnagar', 'Surat', 'Jamnagar'])</div>
<div>
<div>
print(cities)</div>
<div>
<span style="color: blue;">['Mumbai', 'Pune', 'Delhi']</span></div>
</div>
<div>
<div>
print(cities2)</div>
<div>
<span style="color: blue;">['Mumbai', 'Pune', 'Gujarat', ['Vadnagar', 'Surat', 'Jamnagar'], 'Delhi']</span></div>
</div>
<br /><br />From the above example it becomes clear that deepcopy method creates a real copy of the object, list that is which is separate/ independent from the original object. deepcopy is also used for copying compound objects and nested lists<div>
<br /></div>
Sanjay Rajurehttp://www.blogger.com/profile/11542442972509970207noreply@blogger.comtag:blogger.com,1999:blog-2679287135209666721.post-48572573301687646492017-12-13T17:12:00.005+05:302017-12-13T20:19:13.191+05:30Learn Python Easy way Part 5 ListsLet us look learn some more ways to work with Python lists.<br />
There one more way to display the element present in a list at a certain location, using the pop method<br />
<br />
cities = ["Mumbai", "Pune", "Bangalore", "Calcutta"]<br />
cities.pop(0)<br />
<span style="color: blue;">'Mumbai'</span><br />
<br />
<a name='more'></a><br /><br />
You can use the pop methos without an argument, it will return the last item present in the list<br />
in the above example<br />
cities.pop()<br />
<span style="color: blue;">'Calcutta'</span><br />
<br />
You can use the extend method to join two lists together<br />
<br />
cities1 = ["Mumbai", "Pune", "Bangalore", "Calcutta"]<br />
cities2 = ["Kolhapur", "Trivendrum", "Belgaon", "Dibrugadh"]<br />
cities1.extend(cities2)<br />
print(cities1)<br />
<span style="color: blue;">['Mumbai', 'Pune', 'Bangalore', 'Calcutta', 'Kolhapur', 'Trivendrum', 'Belgaon', 'Dibrugadh']</span><br />
<br />
We can also use + operator to join two lists<br />
<br />
cities1 = ["Mumbai", "Pune", "Bangalore", "Calcutta"]<br />
cities2 = ["Kolhapur", "Trivendrum", "Belgaon", "Dibrugadh"]<br />
cities1 + cities2<br />
<span style="color: blue;">['Mumbai', 'Pune', 'Bangalore', 'Calcutta', 'Kolhapur', 'Trivendrum', 'Belgaon', 'Dibrugadh']</span><br />
<br />
To find out the position of an element in a list<br />
we can use the index method<br />
<br />
sweets = ["Rasgulla", "Chamcham", "Basundi", "Balushahi", "Peda"]<br />
sweets.index("Peda")<br />
<span style="color: blue;">4</span>Sanjay Rajurehttp://www.blogger.com/profile/11542442972509970207noreply@blogger.comtag:blogger.com,1999:blog-2679287135209666721.post-62254878732857484442017-12-11T15:30:00.001+05:302017-12-12T13:05:58.027+05:30Learn Python Easy Way Part 4 (Lists)Let us continue from where we left in the last article. We will see some more ways to work with lists in Python<br />
<b><br /></b>
<b>Finding numbers of items in a list</b><br />
<br />
mylist = ['Dehli', 'Washington', 'Tokyo']<br />
len(mylist)<br />
<span style="color: blue;">3</span><br />
<a name='more'></a><br />
<span style="color: blue;"></span><br />
mylistpair = [('India','Dehli'),('USA','Washington'),('Japan','Tokyo')]<br />
<div>
len(mylistpair)</div>
<div>
<span style="color: blue;"> 3</span></div>
<div>
<br /></div>
<div>
<b>Traversing through the items in a list</b></div>
<div>
<br /></div>
<div>
Let us look how to use the items inside a list with For loop</div>
<div>
<br /></div>
<div>
mynames = ["Sanjay", "Abhay", "Shailaja", "Vinay", "Ishaan"]</div>
<div>
<div>
for name in mynames:</div>
<div>
print("Hello",name)</div>
</div>
<div>
<br /></div>
<div>
<div>
<span style="color: blue;">Hello Sanjay</span></div>
<div>
<span style="color: blue;">Hello Abhay</span></div>
<div>
<span style="color: blue;">Hello Shailaja</span></div>
<div>
<span style="color: blue;">Hello Vinay</span></div>
<div>
<span style="color: blue;">Hello Ishaan</span></div>
</div>
<div>
<span style="color: blue;"><br /></span></div>
mynumbers = [11, 22, 33, 44, 55, 66]<br />
<div>
<div>
for num in mynumbers:</div>
<div>
print("Square of number", num, "is",num*num)</div>
<div>
<div>
<br /></div>
<div>
<span style="color: blue;">Square of number 11 is 121</span></div>
<div>
<span style="color: blue;">Square of number 22 is 484</span></div>
<div>
<span style="color: blue;">Square of number 33 is 1089</span></div>
<div>
<span style="color: blue;">Square of number 44 is 1936</span></div>
<div>
<span style="color: blue;">Square of number 55 is 3025</span></div>
<div>
<span style="color: blue;">Square of number 66 is 4356</span></div>
</div>
<div>
<br /></div>
<div>
<b><br /></b></div>
<div>
<b>Using enumerate</b></div>
<div>
<b><br /></b></div>
<div>
<div>
mylist = ['Dehli', 'Washington', 'Tokyo', 'Mosco', 'London']</div>
<div>
<div>
for index, name in enumerate(mylist):</div>
<div>
print("The city" , name , "is ", str(index) , " position in the list")</div>
</div>
<div>
<br /></div>
<div>
<span style="color: blue;"><br /></span></div>
<div>
<span style="color: blue;">The city Dehli is 0 position in the list</span></div>
<div>
<span style="color: blue;">The city Washington is 1 position in the list</span></div>
<div>
<span style="color: blue;">The city Tokyo is 2 position in the list</span></div>
<div>
<span style="color: blue;">The city Mosco is 3 position in the list</span></div>
<div>
<span style="color: blue;">The city London is 4 position in the list</span></div>
</div>
<div>
<span style="color: blue;"><br /></span></div>
<div>
<span style="color: blue;"><br /></span></div>
<div>
<span style="color: blue;"><br /></span></div>
<div>
<br /></div>
</div>
Sanjay Rajurehttp://www.blogger.com/profile/11542442972509970207noreply@blogger.comtag:blogger.com,1999:blog-2679287135209666721.post-90356373188041792102017-12-06T13:47:00.000+05:302017-12-06T13:47:30.344+05:30Learn Python Easy Way - Part 3We will look at the sequential data types in Python. They are Strings, Lists and Tuples. You can access a single character in a string by its index.<br />
<br />
For Example<br />
<br />
Saying = "A Friend in need in a Friend indeed"<br />
print(Saying[0], Saying[3], Saying[4],Saying[7])<br />
A r i d<br />
<a name='more'></a><br />
<br />
Thus you can access any character from a string by mentioning it's index number. The index numbers are counted from 0 onward. This Saying[0] indicates the character in the string in the 0th position. Whereas you can also use negative numbering for indexes. Thus -1 indicated the last character in a string. And -2 will be the second character from the end and so on.<br />
<h3>
<b><br /></b><b>Lists</b></h3>
<div>
<br /></div>
<div>
List in Python is a ordered sequence, it may contain any of the allowed elements in Python. Thus a List may include strings, numbers, special characters, mathematical statements etc.</div>
<div>
<br /></div>
<div>
stateCapitals = ["Mumbai", "Delhi", "Calcutta", "Hyderabad","Bengluru"]</div>
<div>
print("Capital of Maharashtra is "+ stateCapitals[0])</div>
<div>
<span style="color: blue;">Capital of Maharashtra is Mumbai</span></div>
<div>
<br /></div>
<div>
myNumbers=[15,54,87,99,67]</div>
<div>
print("The Fourth number in the list is" , myNumbers[3])</div>
<div>
<span style="color: blue;">99</span></div>
<div>
</div>
<div>
A list can be empty, A list can consists of names, numbers, or mixed. A list can be nested. </div>
<div>
<br /></div>
<div>
You can append an item to a list or insert an item at a location in a list or remove an item from a location in a list.</div>
<div>
<br /></div>
<div>
Let us look at examples of working with elements in a list. </div>
<div>
<br /></div>
<div>
stateCapitals.append("Ahmedabad") </div>
<div>
print("The capital of Gujarat used to be", stateCapitals[5])</div>
<div>
<span style="color: blue;">The capital of Gujarat used to be Ahmedabad</span></div>
<div>
<br />
stateCapitals.insert(5,"Gandhinagar")</div>
<div>
print("However, the present capital of Gujarat is ", stateCapitals[5])</div>
<div>
<span style="color: blue;">However, the present capital of Gujarat is Gandhinagar</span></div>
<div>
<br /></div>
<div>
mylist = ["Maharashtra",["Mumbai","Pune","Nagpur"]]</div>
<div>
print("These are some of the important cities in ", mylist[0]," - ", mylist[1][0], mylist[1][1], mylist[1][2])</div>
<div>
T<span style="color: blue;">hese are some of the important cities in Maharashtra - Mumbai Pune Nagpur</span></div>
<div>
<br /></div>
<div>
<br /></div>
One more interesting built in method/function in lists is to count the number of occurrences of an element in the given list. Let us look at an example<br />
<br />
mylist = ["potato", "banana", "orange", "banana", "pomegranate","banana"]<br />
print( "The term banana has appeared ", count.mylist("banana"), " Times in this list")<br />
<span style="color: blue;">The term banana has appeared 3 Times in this list</span><br />
<span style="color: blue;"><br /></span>
You can slice the elements in a list.<br />
<div>
<br /></div>
<div>
myList = [9, 7, 34, 67, 81, 40, 25]</div>
<div>
print(myList[1:5])</div>
<div>
<span style="color: blue;">[7, 34, 67, 81]</span></div>
<div>
<span style="color: blue;"><br /></span></div>
This will print the list starting from the number at location 1 till the 5th (excluding 5th that is). Remember that the counting of elements in a list begins from 0.<br />
<div>
<br /></div>
<div>
So lists are a versatile Data type in Python that can allow you to do many interesting things that we will see in further articles. </div>
Sanjay Rajurehttp://www.blogger.com/profile/11542442972509970207noreply@blogger.comtag:blogger.com,1999:blog-2679287135209666721.post-28043253319387761712017-11-29T10:58:00.003+05:302017-11-29T12:11:11.797+05:30Sanskrit words for WaterproofingI have recently become interested in Sanskrit. I am amazed and delighted to find out that Sanskrit has many words that carry the meanings for which we use English words in Indian languages. I will list some interesting words in Sanskrit in this series of articles.<br />
<a name='more'></a><br />
<br />
One such word is found in a verse of Bhagwad Geeta. अक्लेद्यो. While describing the characteristics of human soul, Sri Krishna uses this term. It means Waterproof in a modern context.<br />
<br />
Here are some other words that can be used as a replacement for Waterproof in some Indian languages where Jal is the term used for water<br />
<br />
जल प्रतिरोधक<br />
जल रोधक<br />
जलावरोधक<br />
जल निरोधक<br />
<br />
However not all Indian languages use the term Jal to denote Water, I will propose a more common word in Sanskrit that can be applicable in all Indian languages.<br />
<br />
अक्लेद्य<br />
<br />
अक्लेद्य - is the precise word with meaning, that which can not be moistened/ wetted<br />
<br />
For the process of Waterproofing we can use the following terms<br />
<br />
अक्लेद्यन<br />
अक्लेदन<br />
<br />
The beauty of Sanskrit is that you can use many different words to indicate similar thing. They mostly mean the same thing but with subtle nuances, that can be applied as an when required.<br />
<br />
For example if we want to use a word for "Waterproofing compound" we can use the term "अक्लेदक"<br />
or<br />
<br />
Let us look at how these words are constructed.<br />
<br />
<b>क्लिद</b> - To be or become wet or damp<br />
<b>क्लेद </b>- wetness, dampness, moisture<br />
<b>क्लेदन</b> - (Verb) making wet, moistening (This term denotes the process of moistening or wetting something)<br />
<b>क्लेदक</b> - (Noun) An object that can be used to moist something else. Moisturizing agent, or a Sponge used for moistening something.<br />
<b>क्लेद्य </b>- (Adjective) Something that can be made wet, moistened.<br />
<b>अक्लेद्य</b> - (Adjective) Something that can not be made wet or moistened<br />
<br />
Now we have got a word अक्लेद्य that is derived form क्लेद. By using the Sanskrit grammatical construct we can derive more words out of the existing words even if they are not in practice. Here are my derivatives<br />
<br />
<b>अक्लेद्यन </b> - The process of waterproofing, making something un-wet-able.<br />
<b>अक्लेदक</b> - Something that can assist / be used in the process of waterproofing, ie. waterproofing compound.<br />
After manufacturing a waterproof item, the manufacturers can add this term to denote waterproof in Sanskrit (अक्लेद्य ) which has been a term being used even in the Bhagwad Geeta.<br />
<br />
The same term can be used for some other functions<br />
<b>अव-क्लेदन</b> - De-humidification/ De-moisturization<br />
<br />
The word अक्लेद्यन means making something अक्लेद्य that means waterproof<br />
Whereas when we use words such as अक्लेदन, अवक्लेदन - These words would mean making something un-moist or un-wet<br />
<br />
<br />
<br />
<br />
<br />Sanjay Rajurehttp://www.blogger.com/profile/11542442972509970207noreply@blogger.comtag:blogger.com,1999:blog-2679287135209666721.post-48521454852447507052017-11-16T07:42:00.002+05:302017-11-16T10:57:51.634+05:30Learn Python Easy way - Example 3 - Find smallest and largest of given numbersLet us create a easy example in Python to find out smaller of the two numbers. We will ask the user to input two numbers and then compare them and print out the result.<br />
<br />
I have given my logic below, you can do the same program in different ways. Try to make changes to the following code if you have a different algorithm in mind<br />
<br />
<a name='more'></a><iframe allowfullscreen="true" allowtransparency="true" frameborder="no" height="400px" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals" scrolling="no" src="https://repl.it/@sanjayrajure/Example3-findSmallerNumber?lite=true" width="100%"></iframe>
the first two print statements ask the use to enter one number at a time, and press Enter after each input.<br />
number1 and number2 are integer variables. Here we declare the variables and assign them in the same line. int(input()) is the input() function which waits for the use input, and collects the input as an integer and stores that in the variable number1 and number2 respectively.<br />
<br />
Now we will look at the if - elif - else construct. Notice that there are no brackets or parenthesis after if - elif - else. It is not required in Python. However we need to add a Colon : to mark the end of the if - elif - else condition. And the statement follows in the next line with due amount of indentation.<br />
Indentation serve the same purpose as the brackets or the parenthesis would.<br />
<br />
Now to make some coding practice, let us extend the same program to intake three numbers form the user and find out the smallest of them all.<br />
<br />
<br />
<iframe allowfullscreen="true" allowtransparency="true" frameborder="no" height="400px" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals" scrolling="no" src="https://repl.it/@sanjayrajure/findSmallestOf3Numbers?lite=true" width="100%"></iframe>
<br />
<br />
Now let us see a program that will ask the user how many numbers he/she wants to enter and then collect all those numbers and tell the smallest and the largest of them.<br />
<br />
This program shows how you can create a useful program in Python with just a few lines of code.<br />
<br />
<br />
<iframe allowfullscreen="true" allowtransparency="true" frameborder="no" height="400px" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals" scrolling="no" src="https://repl.it/@sanjayrajure/FindSmallestOfnNumbers?lite=true" width="100%"></iframe>
<br />
<h3>
Next
</h3>
Sanjay Rajurehttp://www.blogger.com/profile/11542442972509970207noreply@blogger.comtag:blogger.com,1999:blog-2679287135209666721.post-32578086405443537362017-11-13T07:32:00.000+05:302017-11-16T10:45:24.804+05:30Learn Python easy way - Example 2 NumerologyLet us take a simple program in Python to appreciate the language. We will take the date of birth as user input, then we will add all the digits in the date to a single digit and then we will show the Numerology Life path according to the number.<br />
<br />
Enter the date of birth inside the black panel, without using any separators like dash or slashes.<br />
<a name='more'></a><br />
If you want to download the program on your computer, click on the arrow at the left bottom of the first panel in the compiler below.<br />
<br />
<br />
<iframe allowfullscreen="true" allowtransparency="true" frameborder="no" height="400px" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals" scrolling="no" src="https://repl.it/@sanjayrajure/Numerology-example?lite=true" width="100%"></iframe>
We have defined a function named Add_numbers(dob) in the beginning of the program. dob is the parameter that the function takes. We will collect the dob as an integer from the user at line 20<br />
dob = int(input())<br />
<br />
We will collect the output of the function in a new variable named final_answer and use a if -elif-else construct to print different messages for the value of the final_answer between 1 and 9<br />
<br />
<h3>
Next : <a href="http://www.comprolive.com/2017/11/learn-python-easy-way-example-3-find.html" rel="nofollow" target="_blank">Find the smallest and the largest of given numbers</a></h3>
Sanjay Rajurehttp://www.blogger.com/profile/11542442972509970207noreply@blogger.comtag:blogger.com,1999:blog-2679287135209666721.post-17419909201209551252017-11-10T10:25:00.001+05:302017-11-16T10:55:47.169+05:30Learn Python Easy way - Example 1Let do some math using Python. Suppose you have invited your friends to your Birthday. You have a box of chocolates. You know how many friends are there and how many chocolates are there inside your box. You need to give equal number of chocolates to each of your friends, and you can keep the remaining chocolates in your box.<br />
<a name='more'></a><br />
<br />
Write a program in Python to calculate how many chocolates can be given to each of your friends and how many remain in the box. The number of friends and chocolates can be input by the user and display number of chocolates for each friend and the number of remaining chocolates.<br />
<br />
So first we will ask how many friends are there at your Birthday, and how many chocolates you have with you.<br />
<br />
print ("How many friends are there ?")<br />
friends = int (input ())<br />
print("How many chocolates have you got ?")<br />
chocolates = int (input ())<br />
<br />
We will first use integer division to calculate the maximum number of chocolates that can be distributed equally. We can use the // integer division symbol for that in Python<br />
<br />
maxChocolates = chocolates // friends<br />
<br />
now we will find out how many chocolates remain after distributing. We can use the % modulus operator for that.<br />
<br />
remainingChocolates = chocolates % friends<br />
<br />
Now display the results<br />
<br />
print ("You can share " , maxChocolates , " chocolates to each of your friends")<br />
print("And there will be " , remainingChocolates , " chocolates left in your box")<br />
<br />
friends, chocolates, maxChocolates and remainingChocolates are all variables defined by us. We are using them as integer variables. All of these ways of writing print statements can be useful in different circumstances.<br />
<br />
We are using a comma ( , ) to separate or + to concatenate different strings and % to concatenate strings and integers. We can write the same print statements in three different ways.<br />
<br />
print ("You can share", maxChocolates, "chocolates to each of your friends")<br />
<br />
print ("You can share " + str(maxChocolates) + " chocolates to each of your friends")<br />
<br />
print ("You can share %d chocolates to each of your friends" %maxChocolates)<br />
<br />
To run the following program first click on edit on repl.it to open the compiler in full screen and after that click on run. Enter the user input in the black panel.<br />
<br />
<iframe allowfullscreen="true" allowtransparency="true" frameborder="no" height="400px" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals" scrolling="no" src="https://repl.it/@sanjayrajure/Example-Sharing-Chocolates?lite=true" width="100%"></iframe>
<h3>
<br /></h3>
<h3>
Next : <a href="http://www.comprolive.com/2017/11/learn-python-easy-way-example-2.html" rel="nofollow" target="_blank">Find your Numerology Life path from your date of birth</a></h3>
<div>
<br /></div>
<br />Sanjay Rajurehttp://www.blogger.com/profile/11542442972509970207noreply@blogger.comtag:blogger.com,1999:blog-2679287135209666721.post-39583417328886919802017-11-06T18:46:00.001+05:302017-11-16T10:50:00.979+05:30Learn Python easy way - Part 2<h3 style="text-align: center;">
Reading and Writing in Python</h3>
<div>
<br /></div>
<div>
Let us see how addition is done in Python</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<script src="//repl.it/embed/NoUW/0.js"></script>
</div>
<br />
<a name='more'></a>Now we will try to get input from the user. Press run and then add any two numbers in the adjacent Black window. Each number followed by Enter. As soon as you type two numbers, you will see its sum in the next line.<br />
<br />
<div>
<script src="//repl.it/embed/NoVK/1.js"></script>
</div>
<br />
Now Can you modify the above program to accept three numbers from the user as input and display it's result on the screen. You can do this exercise on the same screen. It will ask if you want to fork. If you have an account on repl.it then you can save the changes made in the code, otherwise press cancel and go ahead with making changes in the code. You can change the code and run it. Only the changes will not be saved after you close the window.<br />
<br />
<h4>
Hint - Solution</h4>
a = int (input())<br />
b = int (input())<br />
c = int (input())<br />
print (a + b + c)<br />
<br />
<h4>
Common mathematical operators used in Python</h4>
<div>
print (2 + 3) # Addition</div>
<div>
print (2 * 3) # Multiplication</div>
<div>
print (2 ** 3) # This means 2 raised to 3, that is 2*2*2</div>
<div>
print ( 3/2) # Division operator</div>
<div>
print (13//3) # Integer division. Remainder is ignored</div>
<div>
print (13 % 3) # Modulus operator. Only remainder is printed</div>
<h4>
<br />User Data Input</h4>
<div>
When you want to receive data from the user, the input () function is used. </div>
<div>
<br /></div>
<iframe allowfullscreen="true" allowtransparency="true" frameborder="no" height="400px" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals" scrolling="no" src="https://repl.it/@sanjayrajure/Example1?lite=true" width="100%"></iframe>
<br />
<div>
<br />
Press Run, and then enter your name in the adjacent black window, then press Enter to see the Welcome message. You can also make changes to the code if you want to. <br />
<br />
<br />
<h3>
<a href="http://www.comprolive.com/2017/11/learn-python-easy-way-example-1.html" rel="nofollow" target="_blank">Next : Calculate Chocolates for your friends</a></h3>
<br /></div>
Sanjay Rajurehttp://www.blogger.com/profile/11542442972509970207noreply@blogger.comtag:blogger.com,1999:blog-2679287135209666721.post-14319981723628643562017-11-05T11:59:00.001+05:302017-11-16T10:54:30.753+05:30Learn Python easy way- Part1From Today we will begin learning Python. Python is considered to be the easiest programming language. The way programming languages are taught, it makes unnecessarily boring. We will try to learn Python in a easier way.<br />
<br />
There will be a video with each article. You will find the link for the video at the bottom of the article. If you come across any problems, you can ask me in comments.<br />
<br />
<br />
<a name='more'></a>You can download Python software from the link below<br />
<br />
<a href="https://www.python.org/downloads/" rel="nofollow" target="_blank">https://www.python.org/downloads/</a><br />
<br />
You will not find it difficult to install the software if you have installed any software before.<br />
<br />
To open the program after the installation is complete, look in the Windows Menu, under "P"<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdVZijGZAadLoolNBsRdyjJMRKJRVvEbcEscE945hZAwoYrhsj3jd1HRDy9MCB7d4_ovi3FR-nHleOYicDZ0ZlKpnE6KuUknOFK-N1Gb1n3OFKb2OYP0SvaEA0B71HS69-VEXDYvBHa8eh/s1600/menu.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="245" data-original-width="372" height="210" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdVZijGZAadLoolNBsRdyjJMRKJRVvEbcEscE945hZAwoYrhsj3jd1HRDy9MCB7d4_ovi3FR-nHleOYicDZ0ZlKpnE6KuUknOFK-N1Gb1n3OFKb2OYP0SvaEA0B71HS69-VEXDYvBHa8eh/s320/menu.png" width="320" /></a></div>
<br />
<br />
If you click on the IDLE (Python..) the Pythn Shell will start. We will learn all our initial programming lessons in this Python Shell<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2omRtfyyrDOfdqkhgGXRipokrgYBiM5f4AYFUSr-G8WKz4YMB0EESdkFCKtIWkS881ut3ImSpSEwK4-8vzjk9xouDx9CHUIj_ysZzLES6QFZERvcI4hpQDksKNc6a9fiQvHaNY-J8_y6o/s1600/python+shell.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="225" data-original-width="400" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2omRtfyyrDOfdqkhgGXRipokrgYBiM5f4AYFUSr-G8WKz4YMB0EESdkFCKtIWkS881ut3ImSpSEwK4-8vzjk9xouDx9CHUIj_ysZzLES6QFZERvcI4hpQDksKNc6a9fiQvHaNY-J8_y6o/s320/python+shell.gif" width="320" /></a></div>
<br />
<br />
<br />
When the Python Shell opens, it's icon starts appearing in the Windows taskbar. If you right click on the icon, you will see "Pin to taskbar" . Select it so that this icon remains always in the taskbar, that will make it easier for you to open the program next time.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNtixFwSj5y6YWhvJNoKaS7dDqtLPM-ax87RFh3SzbJWWiZWan0ogw-Je8rPhs0r73gmQiHH-5wFw8zD-ecQFwg7LLMIoK_pwzH1zvfg3KDsxJ-nnU5-Ofldx3EH2ik1zDHJKuabVV3gqK/s1600/taskbar-icon.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="174" data-original-width="336" height="165" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNtixFwSj5y6YWhvJNoKaS7dDqtLPM-ax87RFh3SzbJWWiZWan0ogw-Je8rPhs0r73gmQiHH-5wFw8zD-ecQFwg7LLMIoK_pwzH1zvfg3KDsxJ-nnU5-Ofldx3EH2ik1zDHJKuabVV3gqK/s320/taskbar-icon.png" width="320" /></a></div>
<br />
<br />
You can also create a Desktop shortcut. For that drag and drop it's menu icon from the Windows menu to the Desktop.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmUq3A7RLwUwmwd6uGvmYRMeXFz_AqWMHwMnBlb8Ujge769zDmQZQpGti3mT5adJv7tC88g60s_fW94HFhCxnoD6YyvWXE7Bj4J-NvA2GPGE2hzeTrrHebCTQfYskgzFospFcUujXCBKeN/s1600/shortcut.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="225" data-original-width="400" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmUq3A7RLwUwmwd6uGvmYRMeXFz_AqWMHwMnBlb8Ujge769zDmQZQpGti3mT5adJv7tC88g60s_fW94HFhCxnoD6YyvWXE7Bj4J-NvA2GPGE2hzeTrrHebCTQfYskgzFospFcUujXCBKeN/s320/shortcut.gif" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Apart from installing a Python software on your computer, you can also try to use a online compiler for Python like the one shown below. <span style="text-align: center;">Here is a compiler from Repl.it</span></div>
<div>
<br />
<br /></div>
<div>
<iframe allowfullscreen="true" allowtransparency="true" frameborder="no" height="400px" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals" scrolling="no" src="https://repl.it/@sanjayrajure/English1?lite=true" width="100%"></iframe>
</div>
<br />
I like this compiler. You can make change to the code and run it in the browser without need to have an account on the Repl.it website. It will ask you to create a fork of the code at first. If you want to save the changes in the code, then you need to log in to your own free account on Repl.it, otherwise ignore the message and play with the code.<br />
<br />
<h3>
<a href="http://www.comprolive.com/2017/11/learn-python-easy-way-part-2.html" rel="nofollow" target="_blank">Next : Reading and Writing in Python</a></h3>
<br />
<br />Sanjay Rajurehttp://www.blogger.com/profile/11542442972509970207noreply@blogger.com