Identity Operators in Python | Python Tutorials for Beginners #lec18

preview_player
Показать описание

Biggest Scholarship of the Year

******************************************

Connect & Contact Me:

******************************************

More Playlists:

#pythonforbeginners #operatorsinpython #programmingtutorial #jennyslectures #gatecse
Рекомендации по теме
Комментарии
Автор

a=5
print(id(a))
a=8
print(id(a))
print(a is a)
true


The variable a is first assigned the value 5, but then it is reassigned to the value 8. Therefore, the second assignment a = 8 changes the value that a refers to.

The expression a is a checks if a is the same object as a, which is always true because it is the same variable. However, the value of a has changed from 5 to 8. So, the output will be True because it is comparing the same object, even though the value has changed

alok_kr_verma
Автор

Please don't stop this series complete it as soon as possible 🙏🙏

funnyanimation
Автор

a = 5
print(id(a))
a = 8
print(id(a))

print(a is a)
this will give true b/z the last a will over right the value of 5 so that at the end of the print(8 is 8)
that means the same value have a same id in python.

robinx
Автор

a = 4
print(id(a))
a = 8
print(id(8))
print(a is a)
The expression a is a checks if a and a reference the same object. Since a is reassigned to reference the 8 object, the expression a is a evaluates to True because a and a both reference the same object 8.

chinenyeumeaku
Автор

the value of a is reassigned to 8 and it compares 8 the object is same if you also check print a==a after this it will also return true so it confirms the value is changed from 5 to 8

mohithmanoj
Автор

we will get True
since the variable assinged is same for the both objects
and first value assinged for variable is re assinged with the second value (i.e 8). Therefore the value of a is taken as 8
and a==a which implies 8==8

akkiaksahyard
Автор

True because both have same address location and of same data type
Like banana shake sharing two members

AnjaneyuluGadelaRamanjaneyulu
Автор

Mam it is better you complete a complete course either C or python. So that we can complete one language fastly. I am 3rd
Year now so it will be helpful to complete a course for placements. I have completed my C programming on ur channel only.

smartsandeep
Автор

please madam help your student out
a = 5
b = 5
print(id(a) is id(b))
the output is False
and you said there memory address is the same, right?
please i need assistance MA

idrithtech
Автор

Thank u for coming back mam and please continue the series too...😍😍😍😍

Rishithabajjuri
Автор

Lecture-17 class assignment qst
1)print(26 & 23) ans= 18
2)print(17 | 24) ans= 25
3)print(17 ^ 24) ans= 9
4)print(~45) ans= (-46)
5)print(56>>3) ans= 7 ... The above answers are corrected as well as binary calculation method and laptop, but 6th problem is coming different values i, e in binary calculation=72 is coming, in laptop python s/w is Coming 272 which one is correct ma'am please reply me and you once again solve the 6th question? Please accept my problems & solve 🙏🙏
6) print(68<<2) which one is correct

basavaraj
Автор

TRUE because, Python always considers recently declared variable and considers that while interpreting upon using any operator for printing the value...

girishbv
Автор

Mam, , , you are my first crush in teacher domain😁❤️😍

nothing-spreading-truth
Автор

E video chusthuntey time yee theliyatley....☺️

shivasai
Автор

Hello! a small doubt
she said, since int is immutable the id changes as the value of var changes.
Then as List is Mutable, then is it a fact that id of the list remains same even if the elements of the list are changed?
Please clarify my doubt

keerthi
Автор

a=5
a=8
print(a is a)
The output is True .
Though the values of both the a's are different but the memory location or the id of both the a's are same.

aishwaryagandhi
Автор

Thank you so much mam for the python vedio.This helps me lot and please continue teaching python.

tejashwinis
Автор

For the assignment, the answer is *True* because the value of a becomes 8 at the end and the ID is changed but since we are checking the ID of the same variable, the answer would be True.

ItsMeAsena
Автор

a=5
print(id(a))
a=8
print(id(a))
print(a is a)
Ans. True (Here, both the Id's of 5 & 8 are different but they stored in the same variable i.e. 'a' and in same memory location )

adamyagogreen
Автор

Hi @jenny Mam,
These lectures are really very helpful, clearing my doubts in python and now python becomes an interesting thing to learn for me.

Thankyou for creating this series of python learning classes. 🙏

vishalsingh
visit shbcf.ru