Errors in Program will stop the execution of program. Error in Python their are two types.
Syntax Error
Run - Time Error
Syntax Error:
Syntax Error is error caused by wrong syntax in the program.
Run - Time Error:
Run time error is also called Exceptions.
Exceptions are raised when program is syntactically correct but code resulted in error.
In the above example raised the ZeroDivisionError as we are trying to divide a number by 0.
Learn Data Science Material which helps to learn concepts in Python, Statistics , Data Visualization, Machine Learning , Deep Learning. And it contains Projects helps to understand the flow of building model , and what are the necessary steps should be taken depending on the data set. Interview Questions helps to crack the interview.
Python 1. Write a program which will find all such numbers which are divisible by 3 but are not a multiple of 7,between 2000 and 3200 (both included). soln : def filter_numbers(): """ function to filter out numbers by extracting numbers which is divisible by 3 but not multiple of 7. """ filtered_list=[] for i in range(2000, 3201): if (i%3==0) and (i%7!=0): filtered_list.append(str(i)) ...
Module - 1 The best practice, while solving the problems on percentage is to calculate 50% , 10% and 1%. Examples : 1. For 500 Ans : For 50% is 50/100 * 500 = 250 For 25% is 25/100 * 500 = 125 For 10% is 10/100 * 500 = 50 For 1% is 1/100 * 500 = 5 Simple ways is For 50% , value is...
Machine Learning Machine Learning is an application of artificial intelligence where a computer/machine learns from the past experiences (input data) and makes future predictions. It finds the pattern in the data , based on the pattern it gives the future predictions from the unseen data. It is a way to understand the data and find the patterns in that. Types of Machine Learning Supervised Machine Learning An algorithm learns from example data and associated target responses that can consist of numeric values or string labels. Generally the algorithm should find the pattern how input and output is mapped Two types of Supervised Learning: Regression: The problem is regression type when the output variable is real or continuous. Example : Predicting salar...
Comments
Post a Comment