• Complain

Bond - Python Programming: Absolute Beginners Tutorial

Here you can read online Bond - Python Programming: Absolute Beginners Tutorial full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2017, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Bond Python Programming: Absolute Beginners Tutorial
  • Book:
    Python Programming: Absolute Beginners Tutorial
  • Author:
  • Genre:
  • Year:
    2017
  • Rating:
    5 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 100
    • 1
    • 2
    • 3
    • 4
    • 5

Python Programming: Absolute Beginners Tutorial: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Python Programming: Absolute Beginners Tutorial" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

A smooth guided introduction to basic programming techniques & concepts utilising the Python Programming language. With step by step learning, working code examples and assistant appendices to get you running code and learning quickly on Windows, Linux or Mac OS.Topics include:* Variables & Arithmetic* Text Handling* Simple Input & Output* Loops* Classes & basic Object Orientated Programming* Libraries* File HandlingThe text is written in a familiar, personal, style. Intended to be a friendly voice to help you feel confident in your growing skills and familiarity, building up from absolute beginner to flourishing file processing.

Bond: author's other books


Who wrote Python Programming: Absolute Beginners Tutorial? Find out the surname, the name of the author of the book and a list of all author's works by series.

Python Programming: Absolute Beginners Tutorial — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Python Programming: Absolute Beginners Tutorial" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make

Python Programming

Absolute Beginners Tutorial

Contents


Introduction

0.0 About this Tutorial

This text is intended to present a friendly voice as you take your first steps into the ever expanding and technical world of computer programming. Step by step, no nonsense, example lead learning which aims to explain all the jargon and make you feel empowered with your new skills.

Whether you have never attempted to learn a programming language before, or always found other tutorials too intense, this text is intended to help you overcome your fears and familiarise you with the most basic concepts about general programming with the Python Programming language.

Example code is given in highlighted blocks, items of special interest are emboldened, though no code example is more than a few lines to keep your focus on the idea rather than the worry of what you are learning.

Any screen shots are captures from real machines.

0.1 What is coding?

Code is essentially a series of lines of text, that the computer can follow to perform tasks for you, control of the order is from top to bottom as you write the lines of code, but it can make the order of actions change with commands within the code itself, to decide to do one thing or another, perform loops or even just quit!

Coding, programming and scripting are all terms for the activity of writing these lines of code. Hacking is similarly one of these terms, however we will only think about hacking in the true, original, sense of the term of inquisitive exploration of technology and our code; we are not considering destructive intrusions.

0.2 How do we start?

If you are not sure how to install or use Python you will benefit from reading the two Appendices before continuing into the main body of the book.

Once you are happy and have Python installed, you will see the chapters are presented with code examples which can be typed directly into the interpreter.

As we progress, definitely by chapter 8, we will be writing code directly into separate files and running those files through Python, real programming painlessly introduced to you.

0.3 Supported Reading!

For support, articles and pointers with your learning you can find my personal blog is available online: http://megalomaniacbore.blogspot.co.uk

You can also find my YouTube channel full of information & learning examples: www.youtube.com/user/LordXelous


Chapter 1: Variables

The simplest thing we can do with a Python program is place a numerical value into a named location for use elsewhere. To place a number into some value we simply write a name for the item and state that it equals the numeric value, thus:

somewhere = 10

To show ourselves the value stored inside the name "somewhere", we can sent this name to the print function, like this:

print (somewhere)

This location we've used is called "somewhere", it could have been called anything we wanted so long as the name we picked isn't in use by some part of Python (known as a reserved word), and it is known as a variable because we can change the value after setting up the initial value, like this:

somewhere = 42

Go a head and print the variable again and you will find it contains a the new value. We've seen that the '=' symbol assigns values to a named variable and that the 'print' function will echo the value to the screen as plain text and also that '( )' brackets are used to enclose variables you pass to a function!

1.1 Arithmetic

When we have assigned a value to a variable, we might want to change the value later, we've seen this when assigning with the '=' symbol. This is called an operator. There are several other operators, the most important are known as the arithmetic operators, because they allow us to carry out simple mathematics. For example:

value = 1 + 2
print (value)

We should see the value "3" printed out! Clearly this is the addition operator.

Performing subtraction is very similar, we just need change to use the '-'symbol...

value = 10 - 3
print(value)

Negative numbers are handled for us also, so if we perform:

value = 3 - 10

We can now see the value is minus 7, and displayed as -7.

The number is lead by the minus symbol, which is the same as the subtract operator symbol, only the spacing tells Python what we intend to do.

So to assign a value of minus five, we do this:

value = -5

Subtracting from a negative number will make it more negative, as will adding one negative number to another number.

You will notice how important the spaces are here to tell python when you intend to subtract or when you intend to indicate a negative number with the '-' symbol, common to both actions.

Try this code out, make sure you are comfortable with it before you continue:

value = -5
print (value)
value = value - 5
print (value)
value = value + -7
print (value)

The next arithmetic operator to look at is multiplication....

another = 12 * 2
print (another)

We get the result 24! Spend sometime writing out multiplications, you can multiply negative numbers too...

Division is the next arithmetic operator, it is represented by yet another symbol, the '/' or forward slash and we use it in just the same way as all the previous operators...

something = 10 / 2
print (something)

We now see the result of '5'. At this point we need to introduce something a little more complex, this is when we have part of a whole number left after a division... Lets consider the following code:

value = 1 / 2

The result is part of a whole number, known as a fraction, so you might expect the result of a half or , however computers don't work with fractions they work with numbers called "floating point". A half is represented as 0.5 and this is the result we see from out code!

Floating point, its problems and limitations, are not strictly within the scope of this tutorial; however, we'd have to recommend you spend sometime exploring these code examples and trying out some divisions now.

You can also directly assign new floating point numbers to variable names, like so...

value = 0.25
print (value)

From this we can then learn that floating point numbers can be made to add, or in this case multiply back, into whole numbers....

value = 0.25
value = value * 4
print (value)

However, you will notice the result, though we know it is '1' is still shown with a floating point indication, making it '1.0'. You can cast this whole number back to an integer with "int"...

value = 0.25
value = value * 4
print (value)
whole = int(value)
print (whole)

If the floating point had a non-whole remainder, it would be lost by this code...

value = 2.75
print (value)
whole = int(value)
print (whole)

The result we should see is two, the 0.75 being lost in the conversion. We will cover using "int" further in chapter 2.

1.2 Basic Arithmetic Operators

The four operators we have covered so far are the most basic mathematical operations we can carry out, it is vital you understand how they work, lets recap...

Arithmetic Operators
Name
Symbol
Example
Addition
+
value = 1 + 2
Subtraction
-
value = 2 - 1
Multiplication
*
value = 2 * 4
Division
/
value = 4 / 2

1.3 Arithmetic Operator Precedence

The mathematicians amongst us will already have been wondering about the precedence of the operations, that is the order in which python handles the math functions as it processes a line of code, when that line contains more than one operation...

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Python Programming: Absolute Beginners Tutorial»

Look at similar books to Python Programming: Absolute Beginners Tutorial. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Python Programming: Absolute Beginners Tutorial»

Discussion, reviews of the book Python Programming: Absolute Beginners Tutorial and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.