Posts

Basic Syntax of Python

Python is case sensitive . Hence a variable with name  codingavengers  is not same as  CodingAvengers For path specification, python uses  forward slashes . Hence if you are working with a file, the default path for the file in case of Windows OS will have backward slashes, which you will have to convert to forward slashes to make them work in your python script. For window's path  C:\folderA\folderB  relative python program path should be  C:/folderA/folderB In python,  there is no command terminator , which means no semicolon  ;  or anything. So if you want to print something as output, all you have to do is: print "Hello, World!" Oops! we just shared the first python program too with you. Yes, just one single statement. In one line only a single executable statement should be written  and the line change act as command terminator in python. To write two separate executable statements in a single line , you should...

4 Reasons to Choose Python as First Language

1.Simple Elegant Syntax Programming in Python is fun. It's easier to understand and write Python code.  Why? The syntax feels natural. Take this source code for an example: a = 2 b = 3 sum = a + b print(sum) Even if you have never programmed before, you can easily guess that this program adds two numbers and prints it. 2.Not overly strict You don't need to define the type of a variable in Python. Also, it's not necessary to add semicolon at the end of the statement. Python enforces you to follow good practices (like proper indentation). These small things can make learning much easier for beginners. 3.Expressiveness of the language Python allows you to write programs having greater functionality with fewer lines of code.You will be amazed how much you can do with Python once you learn the basics. 4.Great Community and Support Python has a large supporting community. There are numerous active forums online which can be handy if you are stuck. Some of th...

Introduction to Python and setting up Python Development Environment

Image
Welcome! This is your first step towards learning Python programming language. Or, Do you know this language already and are here just to revise your concepts?. It doesn't matter which category you belong to because we will be teaching you Python, right from the basics. An experienced programmer might have an advantage of picking up topics and lessons rather quickly, even though we recommend you to not to hurry through the topics, since Python, although being a normal programming language, carries some nice treats for programmers, and you would not want to miss those in the tutorials. For all the noobs out there, there is nothing to worry. You should be happy that you have chosen the most amazing and simple tutorial to learn Python. Why Python? Python is considered as one of the most versatile programming languages. If you have even a little experience in programming, then you will soon notice the difference. Let's take a look at the features of Python. Features o...

C - Basic Syntax

You have seen the basic structure of a C program, so it will be easy to understand other basic building blocks of the C programming language. Tokens in C A C program consists of various tokens and a token is either a keyword, an identifier, a constant, a string literal, or a symbol. For example, the following C statement consists of five tokens − printf ( "Hello, World! \n" ); The individual tokens are − printf ( "Hello, World! \n" ) ; Semicolons In a C program, the semicolon is a statement terminator. That is, each individual statement must be ended with a semicolon. It indicates the end of one logical entity. Given below are two different statements − printf ( "Hello, World! \n" ); return 0 ; Comments Comments are like helping text in your C program and they are ignored by the compiler. They start with /* and terminate with the characters */ as shown below − /* my first program in C */ You cannot have comments within comments...

HTML Editors

Image
Write HTML Using Notepad or TextEdit Web pages can be created and modified by using professional HTML editors. However, for learning HTML we recommend a simple text editor like Notepad (PC) or TextEdit (Mac). We believe using a simple text editor is a good way to learn HTML. Follow the four steps below to create your first web page with Notepad or TextEdit. Step 1: Open Notepad (PC) Windows 8 or later: Open the  Start Screen  (the window symbol at the bottom left on your screen). Type  Notepad . Windows 7 or earlier: Open  Start  >  Programs >   Accessories >   Notepad Step 1: Open TextEdit (Mac) Open  Finder > Applications > TextEdit Also change some preferences to get the application to save files correctly.  In  Preferences > Format >  choose  "Plain Text" Then under "Open and Save", check the box that says "Ignore rich text commands in HTML files". Then open a new d...

First C Program and its Structure

Lets see how to write a simple and most basic C program: #include < stdio . h > int main ( ) { printf ( "Hello,World" ) ; //single line comment return 0 ; /* multi line comments /* } Hello,World Different parts of C program Pre-processor Header file Function Variables Statements & expressions Comments All these are essential parts of a C language program. Pre-processor #include  is the first word of any C program. It is also known as a  pre-processor . The task of a pre-processor is to initialize the environment of the program, i.e to link the program with the header files required. So, when we say  #include <stdio.h> , it is to inform the compiler to include the  stdio.h  header file to the program before executing it. Header file A Header file is a collection of built-in(readymade) functions, which we can directly use in our program. Header files contain definitions of the functions which can ...

Features of C language

Image
It is a robust language with rich set of built-in functions and operators that can be used to write any complex program. The C compiler combines the capabilities of an assembly language with features of a high-level language. Programs Written in C are efficient and fast. This is due to its variety of data type and powerful operators. It is many time faster than BASIC. C is highly portable this means that programs once written can be run on another machines with little or no modification. Another important feature of C program, is its ability to extend itself. A C program is basically a collection of functions that are supported by C library. We can also create our own function and add it to C library. C language is the most widely used language in operating systems and embedded system development today. C Language is an amazing language when it comes to simplicity of syntax with decent functionality. It is a perfect mix of both, which makes it the best contender to be t...

HTML Introduction

Image
What is HTML? HTML is the standard markup language for creating Web pages. HTML stands for Hyper Text Markup Language HTML describes the structure of Web pages using markup HTML elements are the building blocks of HTML pages HTML elements are represented by tags HTML tags label pieces of content such as "heading", "paragraph", "table", and so on Browsers do not display the HTML tags, but use them to render the content of the page A Simple HTML Document Example < !DOCTYPE  html > < html > < head > < title > Page Title < /title > < /head > < body > < h1 > My First Heading < /h1 > < p > My first paragraph. < /p > < /body > < /html > Example Explained The  <!DOCTYPE html>  declaration defines this document to be HTML5 The  <html>  element is the root element of an HTML page The  <head>  element contains meta information about the docu...