Simple Python Program For beginners!!

Simple Python Program For beginners!!



- Python is a Multipurpose programming language.

- It has simple easy to use syntax.

Simple Program To Print "Hello World"


Python language is easy to use. simply for print Hello World we have to use Print keyword.

In python there is no need to do semi-colon (;) at the end of code.

Comment : # is used for comment in python.

Program :




 Here is code for print Hello World with out semi-colon and output will,

Output : Hello World 

    or




Here, the code is with semi-colon.

Output : Hello World

So, as we can see there is no difference between output.


How To Get Data From User  OR


Use Of input Statement


If we want to get data from user then we have to use input keyword.

Program :





Here we take data from user then we have to store it into a variable.

So, here we store in name variable which data we take from the user.

After that we print that variable with print keyword and name variable.

Output :

Enter your name : Khush  // khush is data given by user

Khush



Concatenation Of String 


If we want to print above output as Hello Khush then we have to concat (join) the word Hello and name variable.

" + " operator is used for concatenation in python.

Program :





Output :

Enter your name : Khush  // data from user

Hello Khush     // output



  • In next article we discussed about all string operations in python.So,Keep Join With Us.

How To Install And Setup Python Environment On Windows!!

How To Install And Setup Python Environment On Windows!!



How To Install A Python :


Step 1 : Open the browser and search for ' python '.



Step 2 : When you search for python on google then open a web page like below. then click on official website of python ' python.org '  for download python set up.


Step 3 : Now, official website of python is open and there is a download section where the latest version of python is shown. here, the latest version of python is python 3.7.3. 

Click on the latest version in Download.



Step 4 :  There is many set up available for different operating systems like windows and mac.

If you have windows 64 bit Windows 10 then click on the Windows x86-64 executable installer 




Step 5 :  There  is download an .exe file and then click right and open the downloaded file.


Step 6 : Click on the Install now.


Step 7 : Python is successfully installed and it is ready to use.



How To Start Python Programming In Shell


Step 1 : After successful installation of python go to the all apps option on the windows and go to the alphabet P. In P there is Python 7.3. in option of python 3.7 go to the IDLE. which is shell environment of python.


Step 2 : In python we can write and execute program in the same shell. let's see,


As shown in above example we write a simple

code for print "hello world" : print("Hello World");

And we get output Hello World in same shell.

Step 3 : We use above shell for output and write programing code in codding environment.

So,for go to the New File 



Write your python code.


Step 4 : save it with .py extension.

For Ex : Hello.py



And Run the code.

Step 5 : We get output in python shell like below.


So, this is how we can start python  programming and from next article we start python programming for machine learning so, ready for learn!!

Top 7 Best Programming Languages For Machine Learning!!

Top 7 Best Programming Languages For Machine Learning!!


In this article we discuss about 7 best programming language used for Machine Learning.

  1. Python
  2. Java
  3. R
  4. C++
  5. Lisp
  6. Matlab
  7. Prolog
(1) Python :

- Python described as simple and easy to learn.
- It has the simple syntax which makes easier to work in complex systems.
- In Python we can use python and other programming languages for reach our goal.
- In Python we can choose between scripting and OOPs.
- Python has a rich library system.
   it includes pre-written code that allows user to perform different actions.it gives some base level codes. so, programmer don't need to write code every time.
  • Pandas
  • Jupyter 
  • TensorFlow
  • Scikit-learn
  • Keras

(2) Java :

- Java provides many benefits like : Easy to use
                                                        - Simplified work
                                                        - Easy to work
                                                        - Easy debugging
                                                        - Package services
                                                        - Good user interaction etc..



- Libraries of Machine Learning for java,
  • Weka
  • Deeplearning4j
  • MOA
  • MALLET
  • ELKI

(3) R :


- R allows rapid prototyping and working with data sets.


- There is advantage of advanced data analysis packages that cover the pre-modeling,modeling,post-modeling stages.

(4) C++ :


- C++ creates more compact and faster runtime code.
- In C++ major compilers tend to do specific optimisation and platform specific.
- C++ code is low-level language which means it is easy for computer to read and harder for humans.



- But developers prefer python over C++ because it has more libraries and more easier for developing.


(5) Lisp :


- Lisp allows the construction of executable code at Run-time.
- Lisp has macros that works at the syntax tree level.
- The default data structure for Lisp is linked list.


(6) Matlab :

- Machine Learning is basically maths based programming.
- Matlab gives facility to express maths directl.
- Matlab provides the appropriate tools.
- Matlab provides function and capabilities the developer need.



- Matlab complete tasks easily than other custom programming.
- Matlab runs your program faster and also try bigger problems

(7)  Prolog :

- Prolog is declarative programming language.
- The program logic is expressed in terms of relationship, represented as facts and rules.




What Is Machine Learning

What Is Machine Learning??





We Discuss in this article about :

 What Is Machine Learning ?
 How Does Machine Learning Work ?
 Types Of Machine Learning 
 Applications Of Machine Learning.

What Is Machine Learning?


- So, as we know humans are learn from their past experiences and machines are follow the instructions.
- If machine learn from human how to learn from past experiences Then it is Machine Learning.
- Machine Learning works from on the data development of computer program that can be access data and use it to automatically learn and improve from experiences.

Definition by Tom Mitchell (1998) :

Machine learning is the study of algorithms that
  • Improve their performance P
  • At some task T
  • With experience E.
A well defined learning task is given by <P,T,E>. 

Examples Of Machine Learning In Day To Day Life :

  1. Alexa
  2. Image Recognition
  3. Speech Recognition
  4. Medical Diagnosis etc...

How Does Machine Learning Work ?


Machine Learning uses algorithm to mimic human learnings in machines. It is a subset of Artificial Intelligence.
In Machine Learning There is no need to write programs, Computer automatically generates the program.

Work : 

- We  create a model with trained machine learning algorithm.
- When we gives input to the machine it checks the machine learning algorithm then it creates a prediction and gives output.
- If Output is right then prediction is right and all OK.
- If Output is not right then from the feedback create a further machine learning algorithm and checks till the output not comes right.
- so, this how Machine Learning learns from the mistakes.



Difference between Traditional Programming and Machine Learning :



For more information we have to know about Types Of Machine learning.


Types Of Machine Learning



In Machine Learning machines are used the algorithms and perform on the basis of algorithm and stored input data in the system.

Types :


There Is three part of machine learning :

1) Supervised :
- Develop predictive model based on input and output data.  
- Makes Machine learn explicitly.
- Direct Feedback given.
- Predicts outcome.



2) Unsupervised :
- Group and interpret data based only on input data.
- Does not predict.
- Machine Understands the data.
- Evaluation is indirect.


3) Reinforcement : 
- It learns from the mistake.
- An approach of AI.
- Machine learn how to act in certain environment.

We will discuss in brief about types of machine learning in next article. this is an overview of types for understanding. 


Applications Of Machine Learning 



Social Media : Sentiment Analysis, Filtering spam etc..

Genetics : Exposure, Latent defect, haritable pathology etc..

Financial Services : Algorithm trading, Portfolio Management, Fraud detection etc.. 

Healthcare : Drug Discovery, Disease Diagnosis, Robotic Surgery etc..

Virtual Assistant : Intelligent Agents, Natural Language, Processing etc..

eCommerce : Customer Support, Product Recommendation, Advertising etc..

Transport : Safety, Monitoring, Air traffic control etc.. 


In Addition Answers For  Some Questions Such As :


What Is Machine Learning ?


1) You Can also say that Machine Learning is an extensively algorithm driven study which makes software capable of learning on the basis of experience and improve performance for task.

2) Machine Learning Stands fr learning defined as the acquisition of knowledge or skills through experience, study or by being taught.

3) Machine Learning is the intersection between theoretically sound computer science and practically noisy data.
Essentially, it's about machines making sense out of data in much the same way that we humans do.

4) It is about improving the machine's performance on a specified task with it's experience.


In this article we learn about Machine Learning in short, in next article we discussed in deep about supervised,unsupervised and reinforcement learning with their example.