In this Lecture, I have introduced the concept of programming language and have discussed the following concepts in Programming languages: 1. Literal, Variable and Data Types. 2. Arithmetic Operators. 3. Relational and Logical Operators. 4. If-Else conditions 5. Loops: While and For Loop 6. Functions 7. Lists, Tuples, Dictionary and Sets 8. Classes. 9 Packages in Python
Google Colaboratory is a Python platform provided by Google. In this lecture, I have explained the following: 1. Environment of Google Colaboratory. 2. Save your Notebooks to Google Drive. 3. Writing and executing Python code without installing Python on Laptop. 4. Import datasets/ files from google drive. 5. Free cloud service, GPUs and TPUs. 6. Integrate with different packages like PyTorch, Tensor Flow, Open CV.
In this lecture, I have explained the following: 1. What are Literals or Constants? 2. What do we understand by Variables 3. What are data types and different data types present in Python. 4. How to take input from the user.
In this lecture, I have explained the following: 1. What do we understand by Typecasting, both implicit and explicit typecasting? 2. How to get input of different data types using input command. 3. How to display information and variable values using print command.
Proper display of the information helps in making better experience for the user to use the software. In this lecture, I will explain the different ways of using print command to display the information as per the requirement. Following topics are covered: 1. To display the value of variables in between the text using % symbol. 2. To display the value of variables in between the text using format. 3. How to customize the end of print command. 4. Use of format method to display FLOAT VALUE as per the requirement. 5. Use of format method to display STRING VALUE as per the requirement.
Arithmetic operators help in writing mathematical expressions in a programming language. Following topics are covered regarding arithmetic operators: 1. Operators vs Operands. 2. Unary operators. Eg -12 3. Binary operators. Eg. 2+3 4. Ternary operators: [on_true] if [expression] else [on_false] 5. Operator Precedence and Rule of Associativity
Assignment: 1. Write a program to print the text I the proper format mentioned. Name: Dr. Nishant Jain Highest Qualification: Ph.D. University: IIT Roorkee 2. Write a program to determine the area of a rectangle. Length and breadth to be entered by the user. 3. Write a program to determine the average of three integer numbers entered by the user. Display the output upto 4 decimal place. 4. Write a program to ask user to enter three digit number and print the individual digits of the three digit number on a separate lines. Eg. If the three digit number entered is 123, then output should be: Three digits of 123 are: 1 2 3
Most of the decisions we take in our life depend on the answer to some questions. So questions and their answers decide the path we need to follow. Similarly, in programming languages, we need to ask questions, so that our program can decide the path it has to follow. In programming language, these questions can be asked using Relational and Logical Operators. In this Lecture I will explain the following: 1. Boolean Data Types. 2. Relational operators. 3. Logical Operators. 4. Precedence Rule for Arithmetic, Relational and Logical operators. 5. Relational operators in Arithmetic expressions.
Most of the decisions we take in our life depend on the answer to some questions. So questions and their answers decide the path we need to follow. Similarly, in programming languages, we need to ask questions, so that our program can decide the path it has to follow. In programming language, the path to follow can be selected using an if-else statement. In this Lecture I have explain the following: 1. Short-circuit (Lazy) evaluation. 2. If Statement. 3. If-else statement.
In programming languages on the basis of the answer to the question or condition asked using relational and logical operators, one path out of two possible paths can be selected using an if-else statement. In this Lecture I have given more insight into if-else statement by solving some problem questions and then I have explained the use of nested if-else statement in Python. Nested if-else statement can also be implemented using elif statement in python.
Quite often, while following any path/plan we have to make a decision at multiple points, that is we may need to ask several questions not only at the same time (using logical operators) but also after moving some steps ahead. Same thing can be replicated in programming languages using nested if-else statement. In this Lecture I have explain the use of nested if-else statement in Python. How nested if-else statement can also be implemented using elif statement in python is also discussed.
Solutions of the following problems based on Arithmetic, Relational and Logical Operator are discussed in this lecture: 1. In a 50 over match, for the first N overs Indian cricket team scored with a run rate of R that is R runs per over. Display the run rate with which Indian team should score a run in the remaining overs so that the final score of the team reaches to S. Values of N, R, and S should be entered by the user. Display the output upto two decimal places. 2. Person A finishes work in N days. The same work can be completed by person B in M days. Display the number of days, D in which the same work can be completed if they (both A and B) work together. Values of N, and M should be entered by the user. Display the output upto two decimal places. 3. If a single taxi can carry ?A? number of passengers, then display the number of taxis that will be required to carry ?N? number of passengers. Also display the distribution of the passengers in the taxis. Values of A, and N should be entered by the user. Assume N will always be greater than A.
Most of our actions need repetitive steps. For example when we count the total number of people entered through any entrance gate, then the steps involved are: Step1: Allow one person through the gate. Step2: Add one to the count. Step3: Goto Step 1 until all the people are inside the gate. Other examples of repetitive steps are updating cricket score on scoring board, preparing a bill for all the products purchased by a customer, etc. Even when we walk, we are doing a repetitive task of analyzing if it safe to take next step and taking a next step if it is safe. In this lecture I have explained how the repetitive task can be implemented using while loop in Python programming. I have explained the syntax of while loop and the working of while loop is explained with the help of an example.
Continuing while loop discussed in the last lecture, in this lecture I have discussed the following programs: 1. Program to reverse a given number. 2. Displaying all the multiples of 7 before 100.
To manage any record we need to put or group all different types of data at one place. For example, information of the marks scored by a student in different subjects should be grouped together. We also need to group marks scored by all the students in the class like we do using an excel file. In this lecture, I have explained how the data can be grouped by creating a List in Python. I have discussed the following: 1. How to create a 1 dimensional list and Multi-dimensional list? 2. How can the values in the list be accessed? 3. How can the sub-list be created from the main list?
Continuing with explanation of 3 topics on List in lecture 15, in this lecture, I have explained the following: 4. How to display the list in reverse order? 5. How to get the number of elements in the List using the function len(). 6. How to get the index value of any element present in the list?
Continuing with explanation of 6 topics on List in lecture 15 and 16, in this lecture, I have explained the following: 7. How to replace the value at any particular index of the list? 8. How to delete elements from the list using the function del() ? 9. How to insert a new element at a particular index within the list? 10. How to sort the data in the list? 11. How to arrange the list in reverse order? 12. How to get the maximum and minimum number in the list? 13. How to get the sum of the numbers present in the list? 14. How to combine or concatenate the two given lists?
Continuing with the explanation of 14 topics on List in lectures 15,16 and 17, in this lecture, I have explained the following: 15. How to compare the two lists? 16. How to copy the content on one list into another? 17. Some programming examples on List.
In this lecture, I have explained the following: 1. The working of For Loop with list. 2. Use of Range in the for loop.
In this lecture, I have explained the following: 1. Examples to understand for loops. 2. The use of break and continue statements in the loops. 3. Use of else in the for loop.