Presentation is loading. Please wait.

Presentation is loading. Please wait.

PROGRAMMING USING PYTHON LANGUAGE ASSIGNMENT 1. INSTALLATION OF RASPBERRY NOOB First prepare the SD card provided in the kit by loading an Operating System.

Similar presentations


Presentation on theme: "PROGRAMMING USING PYTHON LANGUAGE ASSIGNMENT 1. INSTALLATION OF RASPBERRY NOOB First prepare the SD card provided in the kit by loading an Operating System."— Presentation transcript:

1 PROGRAMMING USING PYTHON LANGUAGE ASSIGNMENT 1

2 INSTALLATION OF RASPBERRY NOOB First prepare the SD card provided in the kit by loading an Operating System into it. Step 1- Formatting the SD card: The SD card in mounted on the laptop and resulted to formatting. To ensure proper formatting, a software called SD Association’s Formatting Tool can be used too. Step 2- Formatting the entire device as FAT 3. Download the Noobs Software from the Raspberry pi official website, extract the files and copy them onto the SD card. Load this SD card into the SD card slot and you are ready to go.

3 PROGRAMMING IN PYTHON Python is an interpreted language wherein a special software reads the code and runs the file. The programs are generally written in an Integrated Development Environment (IDE) which is basically a text editor that is packaged with other tools to make writing a code a lot easier.

4 WRITING PROGRAMS IN PYTHON The simplest of the language is used to do programming using python. Most of it is natural language. Print ‘Hello World’ can be as simple as – print(‘Hello World’) The IDE we are using here is Python 3 that works like Linux Terminal i.e it runs the given input in the same environment. One more thing to observe here is, we can also create a new file from the Shell, write a program in that and have it executed from the file to the Shell.

5 FEATURES OF PYTHON LANGUAGE Like any other programming, we can use comments # in this language too. Any basic or complex arithmetic operations can be performed like addition, subtraction, multiplication, division. Variables can be used but they should start with a letter(a-s) or (A-Z) followed by any number, letter or an underscore. They can hold any type of information starting from numbers, strings, boolean set, dictionary to lists etc.

6 LISTS AND DECISIONS Lists collect items together into a single list. They are ordered- each slot in the list is given a number starting from 0. Decisions is indication of Trueness or Falsity of an expression depending on which, one can use different operations. This is done by using if and if else statements. Many operators can be used like- ==, !=,, =. And for combining two expressions we can use the AND and OR.

7 LOOPS, FUNCTIONS AND CLASSES OBJECTS Loops are blocks of code that repeat a sequence of Python commands a set number of times, or continuously until a certain condition is met. Functions are mainly used to break a Python program into smaller parts. One must specify arguments while writing functions (An argument is nothing but a variable or a value that one can pass into a function). One can also not use the arguments by specifying the default value for a parameter that is being used in the function. A class is like a blueprint which describes the structure of the objects and defines their methods. Other Object oriented concepts used in python are Inheritance, Methods, Encapsulation etc.

8 MODULES PACKAGES AND FILE I/O A module is a collection of functions and classes that are related to s specific purpose. Some of the important modules are: base64, curses, http, PIL etc. Packages group modules together in namespaces – organized and hierarchical trees of modules. It is like working with file systems, except you use dots instead of slashes. Raspbian in- built functions can be used to control the I/O system. The operations one can do are- Opening a file, Reading from a file, Writing text to a file, Appending text to a file, Renaming and Deleting files and working with folders.


Download ppt "PROGRAMMING USING PYTHON LANGUAGE ASSIGNMENT 1. INSTALLATION OF RASPBERRY NOOB First prepare the SD card provided in the kit by loading an Operating System."

Similar presentations


Ads by Google