Posts

Showing posts from November, 2024

Day 45 *Final*

Why Python? Python works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc). Python has a simple syntax similar to the English language. Python has syntax that allows developers to write programs with fewer lines than some other programming languages. Python runs on an interpreter system, meaning that code can be executed as soon as it is written. This means that prototyping can be very quick. Python can be treated in a procedural way, an object-oriented way or a functional way. Good to know The most recent major version of Python is Python 3, which we shall be using in this tutorial. However, Python 2, although not being updated with anything other than security updates, is still quite popular. In this tutorial Python will be written in a text editor. It is possible to write Python in an Integrated Development Environment, such as Thonny, Pycharm, Netbeans or Eclipse which are particularly useful when managing larger collections of Python files.

Day 44

What is Python? Python is a popular programming language. It was created by Guido van Rossum, and released in 1991. It is used for: web development (server-side),  software development,  mathematics, system scripting. What can Python do? Python can be used on a server to create web applications. Python can be used alongside software to create workflows. Python can connect to database systems. It can also read and modify files. Python can be used to handle big data and perform complex mathematics. Python can be used for rapid prototyping, or for production-ready software development.

Day 43

What is Python? Python is a popular programming language. It was created by Guido van Rossum, and released in 1991. It is used for: web development (server-side),  software development,  mathematics, system scripting. What can Python do? Python can be used on a server to create web applications. Python can be used alongside software to create workflows. Python can connect to database systems. It can also read and modify files. Python can be used to handle big data and perform complex mathematics. Python can be used for rapid prototyping, or for production-ready software development.

Day 42

Python File Handling In our File Handling section you will learn how to open, read, write, and delete files. Python File Handling Python Database Handling In our database section you will learn how to access and work with MySQL and MongoDB databases: Python MySQL Tutorial Python MongoDB Tutorial

Bay 41

Python Tutorial Learn Python Python is a popular programming language. Python can be used on a server to create web applications. Learning by Examples With our "Try it Yourself" editor, you can edit Python code and view the result. Example print ( "Hello, World!" ) it’s considered easier than the other languages, although it’s a powerful language and useful

Day 40

C# Constants Constants If you don't want others (or yourself) to overwrite existing values, you can add the   const  keyword in front of the variable type. This will declare the variable as "constant", which means unchangeable and read-only: Example const int myNum = 15; myNum = 20; // error

Day 39

Syntax type variableName = value; Where  type  is a C# type (such as  int  or  string ), and  variableName  is the name of the variable (such as  x  or  name ). The  equal sign  is used to assign values to the variable. To create a variable that should store text, look at the following example: Example Create a variable called  name  of type  string and assign it the value " John ": string name = "John"; Console.WriteLine(name);

Day 38

C# Variables Variables are containers for storing data values.  In C#, there are different  types  of variables (defined with different keywords), for example: int  - stores integers (whole numbers), without decimals, such as 123 or -123 double  - stores floating point numbers, with decimals, such as 19.99 or -19.99 char  - stores single characters, such as 'a' or 'B'. Char values are surrounded by single quotes string  - stores text, such as "Hello World". String values are surrounded by double quotes bool  - stores values with two states: true or false Declaring (Creating) Variables To create a variable, you must specify the type and assign it a value:

Day 37

C# Multi-line Comments Multi-line comments start with  /*  and ends with  */ . Any text between  /*  and  */  will be ignored by C#. This example uses a multi-line comment (a comment block) to explain the code: Example /* The code below will print the words Hello World to the screen, and it is amazing */ Console.WriteLine("Hello World!");

Day 36

C# Comments Comments can be used to explain C# code, and to make it more readable. It can also be used to prevent execution when testing alternative code. Single-line Comments Single-line comments start with two forward slashes ( // ). Any text between  //  and the end of the line is ignored by C# (will not be executed). This example uses a single-line comment before a line of code:

Day 35

The Write Method There is also a  Write()  method, which is similar to  WriteLine() . The only difference is that it does not insert a new line at the end of the output: Example Console.Write("Hello World! "); Console.Write("I will print on the same line.");

Day 34

C# Output To output values or print text in C#, you can use the  WriteLine()  method: Example Get your own C# Server Console.WriteLine("Hello World!"); You can add as many  WriteLine()  methods as you want. Note that it will add a new line for each method: Example Console.WriteLine("Hello World!"); Console.WriteLine("I am Learning C#"); Console.WriteLine("It is awesome!");

Day 33

Example explanation for the previous code Example explained Line 1:   using System  means that we can use classes from the  System  namespace. Line 2:  A blank line. C# ignores white space. However, multiple lines makes the code more readable. Line 3:   namespace  is used to organize your code, and it is a container for classes and other namespaces. Line 4:  The curly braces  {}  marks the beginning and the end of a block of code. Line 5:   class  is a container for data and methods, which brings functionality to your program. Every line of code that runs in C# must be inside a class. In our example, we named the class Program.

Day 32

C# Syntax In the previous chapter, we created a C# file called Program.cs, and we used the following code to print "Hello World" to the screen: Program.cs using System;namespace HelloWorld{class Program{static void Main(string[] args){ Console.WriteLine("Hello World!");}}} Result: Hello World!

Day 31

Learning C# At W3Schools When learning C# at W3Schools.com, you can use our "Try it Yourself" tool, which shows both the code and the result. This will make it easier for you to understand every part as we move forward: Program.cs using System;namespace HelloWorld{class Program{static void Main(string[] args){ Console.WriteLine("Hello World!");}}}

Day 30

C# Introduction What is C#? C# is pronounced "C-Sharp".  It is an object-oriented programming language created by Microsoft that runs on the .NET Framework. C# has roots from the C family, and the language is close to other popular languages like  C++  and  Java . The first version was released in year 2002. The latest version,  C# 12 , was released in November 2023. C# is used for: Mobile applications Desktop applications Web applications Web services Web sites Games VR Database applications And much, much more!

Day 29

Why Use C#? It is one of the most popular programming languages in the world It is easy to learn and simple to use It has huge community support C# is an object-oriented language which gives a clear structure to programs and allows code to be reused, lowering development costs As C# is close to  C ,  C++  and  Java , it makes it easy for programmers to switch to C# or vice versa Get Started This tutorial will teach you the basics of C#. It is not necessary to have any prior programming experience.

Day 28 C#

Today’s topic is C# C# Tutorial Learn C# C# (C-Sharp) is a programming language developed by Microsoft that runs on the .NET Framework. C# is used to develop web apps, desktop apps, mobile apps, games and much more. Examples in Each Chapter Our "Try it Yourself" editor makes it easy to learn C#. You can edit C# code and view the result in your browser. Example Get your own C# Server using System;namespace HelloWorld{class Program{static void Main(string[] args){ Console.WriteLine("Hello World!");}}}

Day 27

C++ Comments Comments can be used to explain C++ code, and to make it more readable. It can also be used to prevent execution when testing alternative code. Comments can be singled-lined or multi-lined. Single-line Comments Single-line comments start with two forward slashes ( // ). Any text between  //  and the end of the line is ignored by the compiler (will not be executed). This example uses a single-line comment before a line of code: Example // This is a comment cout <<  "Hello World!" ;

Day 26

C++ New Lines New Lines To insert a new line in your output, you can use the  \n  character: Example #include <iostream> using namespace std; int  main() {   cout <<  "Hello World!  \n " ;  cout <<  "I am learning C++" ;    return   0 ; }  You can also use another  <<  operator and place the  \n  character after the text, like this: Example #include <iostream> using namespace std; int  main() {   cout <<  "Hello World!"   <<  "\n" ;  cout <<  "I am learning C++" ;    return   0 ; }

Day 25

C++ Output Numbers C++ Print Numbers You can also use  cout()  to print numbers. However, unlike text, we don't put numbers inside double quotes: Example #include <iostream> using namespace std; int  main() {   cout <<  3 ;    return   0 ; }  You can also perform mathematical calculations: Example cout <<  3  +  3 ; 

Day 24

C++ Output (Print Text) The  cout  object, together with the  <<  operator, is used to output values and print text. Just remember to surround the text with double quotes ( "" ): Example #include <iostream> using namespace std; int  main() {    cout  <<  "Hello World!" ;    return   0 ; }

Day 23

Many Statements Most C++ programs contain many statements. The statements are executed, one by one, in the same order as they are written: Example cout <<  "Hello World!" ; cout <<  "Have a good day!" ; return   0 ;  Example explained From the example above, we have three statements: cout << "Hello World!"; cout << "Have a good day!"; return 0; The first statement is executed first (print "Hello World!" to the screen). Then the second statement is executed (print "Have a good day!" to the screen). And at last, the third statement is executed (end the C++ program successfully).

Day 22

C++ Statements A  computer program  is a list of "instructions" to be "executed" by a computer. In a programming language, these programming instructions are called  statements .  The following statement "instructs" the compiler to print the text "Hello World" to the screen: Example cout <<  "Hello World!" ; It is important that you end the statement with a semicolon  ; If you forget the semicolon ( ; ), an error will occur and the program will not run: Example cout <<  "Hello World!"

Day 21

Omitting Namespace You might see some C++ programs that runs without the standard namespace library. The  using namespace std  line can be omitted and replaced with the  std  keyword, followed by the  ::  operator for some objects:  Example #include <iostream> int  main() {    std:: cout <<  "Hello World!" ;    return   0 ; }

Day 20

C++ Syntax Let's break up the following code to understand it better: Example #include <iostream> using namespace std; int  main() {   cout <<  "Hello World!" ;    return   0 ; }  Example explained Line 1:   #include <iostream>  is a  header file library  that lets us work with input and output objects, such as  cout  (used in line 5). Header files add functionality to C++ programs. Line 2:   using namespace std  means that we can use names for objects and variables from the standard library.

Day 19

C++ Get Started To start using C++, you need two things: A text editor, like Notepad, to write C++ code A compiler, like GCC, to translate the C++ code into a language that the computer will understand There are many text editors and compilers to choose from. In this tutorial, we will use an IDE (see below). C++ Install IDE An IDE (Integrated Development Environment) is used to edit AND compile the code. Popular IDE's include Code::Blocks, Eclipse, and Visual Studio. These are all free, and they can be used to both edit and debug C++ code. Note:  Web-based IDE's can work as well, but functionality is limited. We will use  Code::Blocks  in our tutorial, which we believe is a good place to start. You can find the latest version of Codeblocks at  http://www.codeblocks.org/ . Download the  mingw-setup.exe  file, which will install the text editor with a compiler.

Day 18

What is C++? C++ is a cross-platform language that can be used to create high-performance applications. C++ was developed by Bjarne Stroustrup, as an extension to the  C language . C++ gives programmers a high level of control over system resources and memory. The language was updated 5 major times in 2011, 2014, 2017, 2020, and 2023 to C++11, C++14, C++17, C++20, and C++23. Why Use C++ C++ is one of the world's most popular programming languages. C++ can be found in today's operating systems, Graphical User Interfaces, and embedded systems. C++ is an object-oriented programming language which gives a clear structure to programs and allows code to be reused, lowering development costs. C++ is portable and can be used to develop applications that can be adapted to multiple platforms. C++ is fun and easy to learn! As C++ is close to  C ,  C#  and  Java , it makes it easy for programmers to switch to C++ or vice versa. Difference between C and C++ C++ was developed...