Skip to player
Skip to main content
Search
Connect
Watch fullscreen
Like
Bookmark
Share
More
Add to Playlist
Report
11 - Python Fundamentals II
Extramarks (Old)
Follow
6 months ago
Category
📚
Learning
Transcript
Display full video transcript
00:00
Getting started with Python
00:02
The concepts are
00:11
Introduction to the topic
00:13
Variables
00:14
Dynamic typing
00:16
Simple input and output
00:18
Recapitulation of the topic
00:20
Here is a simple Python program.
00:25
Isn't it quite tedious to understand the code?
00:27
The basic structure of a Python program contains various components like expressions, statements, comments, function, blocks and indentation.
00:39
Now let's discuss these further.
00:43
An expression is any legal combination of symbols that represents a value.
00:49
An expression is evaluated and then produces a value.
00:52
A statement is a programming instruction that executes some action.
00:59
Following are some examples of statements.
01:03
Comments are the additional readable information which is read by the programmers but ignored by a Python interpreter.
01:11
In Python, comments begin with symbol hash and end with the end of physical line.
01:16
A function is a named block of code that can be reused by specifying its name in the program where needed.
01:26
A group of one or more statements is called block or suite.
01:31
Unlike many programming languages such as C, Java, etc. that use curly brackets to show blocks, Python rather uses indentation.
01:40
A variable in Python denotes a memory location that stores some value.
01:47
A variable gives data to the computer for processing.
01:51
In Python, to create a variable, just assign to its name the value of appropriate type.
01:57
For example, to create a numeric variable, assign a numeric value to variable name and so on.
02:04
L values are the objects to which we can assign a value or expression.
02:11
R values are the literals and expressions that are assigned to L values.
02:17
Here, A and B are L values, whereas 20 and 10 are R values.
02:24
We can assign same value to multiple variables in a single statement.
02:28
We can even assign multiple values to multiple variables in a single statement.
02:34
It will assign the values order-wise.
02:37
That is, first variable is given first value, second variable the second value and so on.
02:44
A variable is created only when we assign some value to it.
02:49
To understand it, consider the following code fragment.
02:52
When we run the code, it will produce an error.
02:55
Using an undefined variable in an expression or statement causes an error called name error.
03:03
Dynamic typing is a feature of Python in which a variable pointing to a value of a certain type
03:09
can be made to point to a value of different type.
03:14
On the basis of concept learnt, try to answer the questions.
03:19
Choose the correct option from the given options.
03:25
Choose the correct option from the given options.
03:38
In Python, input from user is taken by using built-in function input
03:43
and to send output to standard output devices, another built-in function, print, is used.
03:51
The built-in function input is used in the following manner to obtain the input from the user.
03:58
In above code, we used input function to input two values.
04:02
In this example, error is shown because the input function always returns a value of string type
04:10
because whatever value we enter through input function is treated as string.
04:15
But what to do if we have to read numbers?
04:19
In this case, Python offers two functions to be used with input function to convert the values received into int and float types.
04:29
The print function is a way to send output to monitor.
04:34
The syntax to use print function is as follows.
04:36
Now consider some print statement examples and their output.
04:44
On the basis of concept learnt, try to answer the questions.
04:49
Let's go through some project work.
04:54
Can you predict the output of following code fragment?
04:57
Write a program to input two numbers and print their sum.
05:09
Here is a program to input two numbers and print their sum.
05:12
The output is as follows.
05:15
Let us recapitulate the concepts.
05:18
A statement is a programming instruction that executes some action.
05:23
A variable can be assigned to a literal or to an expression.
05:26
Dynamic typing is a feature of Python in which a variable pointing to a value of a certain type
05:33
can be made to point to a value of different type.
05:56
a solution, an expression kind of the type oficon.
06:14
manner of behaviority.
06:18
The output is a visual a built-in relationship.
Be the first to comment
Add your comment
Recommended
7:54
|
Up next
9 - List Function & Methods
Extramarks (Old)
6 months ago
9:10
8 - Getting Started With Python
Extramarks (Old)
6 months ago
16:42
10 - Online Access To Computer Security
Extramarks (Old)
6 months ago
16:38
12 - Introducing DBMS
Extramarks (Old)
6 months ago
9:34
7 - Working With Dictionaries
Extramarks (Old)
6 months ago
7:52
7 - Dictionaries
Extramarks (Old)
6 months ago
10:07
9 - Working With List
Extramarks (Old)
6 months ago
6:38
11 - Python Fundamentals I
Extramarks (Old)
6 months ago
9:50
6 - Debugging Programs
Extramarks (Old)
6 months ago
19:04
2 - Basics of computer system
Extramarks (Old)
6 months ago
8:02
3 - Statements In Python
Extramarks (Old)
6 months ago
13:05
5 - Operators
Extramarks (Old)
6 months ago
15:17
4 - Cyber Security
Extramarks (Old)
6 months ago
10:32
1 - Data Representation
Extramarks (Old)
6 months ago
11:11
5 - Expressions
Extramarks (Old)
6 months ago
9:57
5 - Data Types
Extramarks (Old)
6 months ago
5:08
3 - Conditional Statements
Extramarks (Old)
6 months ago
7:20
3 - Iterative Statements
Extramarks (Old)
6 months ago
5:48
1 - Boolean Algebra
Extramarks (Old)
6 months ago
0:51
Former Aide Claims She Was Asked to Make a ‘Hit List’ For Trump
Veuer
2 years ago
1:08
Musk’s X Is ‘the Platform With the Largest Ratio of Misinformation or Disinformation’ Amongst All Social Media Platforms
Veuer
2 years ago
4:50
59 companies that are changing the world: From Tesla to Chobani
Fortune
2 years ago
0:46
3 Things to Know About Coco Gauff's Parents
People
2 years ago
0:35
8 Things to Do in the Morning to Improve Productivity
Martha Stewart Living
2 years ago
2:11
Why You Should Remember Aretha Franklin
Goalcast
2 years ago
Be the first to comment