Python 'is' vs '==': What's The Difference? | Python Tutorials For Absolute Beginners In Hindi #90

  Рет қаралды 39,737

CodeWithHarry

CodeWithHarry

Күн бұрын

Пікірлер: 434
@rajanagrahari6869
@rajanagrahari6869 4 жыл бұрын
Task:- a = [6, 4, "36"] b = [6, 4, "36"] print(b is a) Output will be False Because here both a and b is pointing different list, Here both has allocated different memory location or address
@Allin-dd8gj
@Allin-dd8gj 2 жыл бұрын
Winner!
@SurajSingh-mf3vz
@SurajSingh-mf3vz 6 жыл бұрын
Aaj tak mein ye samjhta tha ki 'is' aur '==' dono ek hi kam karte hain. Thank you #harry bro for this video!
@ravindraakate6677
@ravindraakate6677 6 жыл бұрын
The output is:>False Because of their having a different memory location
@dakshgarg775
@dakshgarg775 4 жыл бұрын
sir main aapka course 1st video se dhekta aaraha hoon par aapke is course ke daalne ke 1 saal baad and you are the best
@ramchandrainamdar6742
@ramchandrainamdar6742 6 жыл бұрын
a == b is true ; a is b is false. Reason: a and b point to different locations(different memory boxes); though having same values.
@rickk3300
@rickk3300 3 жыл бұрын
4:20 it will print False because a and b refer to different lists containing the same set of values.
@bollyone3930
@bollyone3930 5 жыл бұрын
sir false print kareaga khoi value same ha par valueholder same nahi ha ----- Example :- A ke pass Oppo f1s ha aur B ke pass bhi Oppo f1s ha to mobile(value) to same par mobile owner(valueholder) same nahi ha. Thank You.
@raviyadav2552
@raviyadav2552 4 жыл бұрын
Thnx for the example
@Erwinsmith94040
@Erwinsmith94040 4 жыл бұрын
Great example
@akhileshyadav1280
@akhileshyadav1280 4 жыл бұрын
sir ka lecsamajta hai kya?
@akhileshyadav1280
@akhileshyadav1280 4 жыл бұрын
as a new beginner i am askjng
@Erwinsmith94040
@Erwinsmith94040 4 жыл бұрын
@@akhileshyadav1280 kaafi kuch samjhta hai kuch concept chod ke
@sarv4265
@sarv4265 Жыл бұрын
Task: output --> False, because a and b are different lists as if i want to add another element in list a i have to do a.append(item) but by doing this b will not be affected.
@kanhataak1269
@kanhataak1269 5 жыл бұрын
a= [6,4,"34"] b = [6,4,"34"] print(b == a) #True print(b is a)# False
@sailendrachettri8521
@sailendrachettri8521 4 жыл бұрын
why False?
@bushranikhat2326
@bushranikhat2326 4 жыл бұрын
False islye kyunki dono alg alg memory location k objects hai....agr memory location bhi same hota toh true ata.
@sammyeditz3431
@sammyeditz3431 3 жыл бұрын
The result of : a = [1, 34, ''35' ] b = [1, 34, '35'] b is a prints False. Kyunki ye dono alag alag objects hai aur alag memory me stored hai. But if we do: a = [1, 34, ''35' ] b = a b is a prints True Bcoz they have been made by refferncing to the object/variable 'a'
@lone_wolf2020
@lone_wolf2020 2 жыл бұрын
a = [6, 4 , "36" ] and b = [6, 4 , "36" ] now , print (a is b) , return false cause they are not in same memory location, and both are different object. they might have same values. But they are different.
@siddheshpanajkar660
@siddheshpanajkar660 11 ай бұрын
# Task -> a = [6, 4, "34"] b = [6, 4, "34"] print(b is a) Output will be False Because, both a and b are pointing different list and are allocated in different memory location or address #codewithharry
@RaviYadav-ru1nu
@RaviYadav-ru1nu 4 жыл бұрын
Awesome Harry bhai; You are my inspiration; Aapki series follow karke mai kaafee improvement dekh pa ra hu '''''''''''''''''''''''''''''Vaise aapke task ''''''''''''''''''''''''''''''ka answer : False Hai. meri best wishes aapke saath hai. Aap meri life k best teacher ho .
@mohdasad4256
@mohdasad4256 3 жыл бұрын
check it a = [6,4,"34"] b = [6,4,"34"] print(b is a) # output - False , beacuse a and b are located at different memory location. print(b==a) # output - True
@implementation8489
@implementation8489 3 жыл бұрын
4:22 --> b is a = False. Because memory id is different in these variables.
@productive5
@productive5 3 жыл бұрын
Answer of task.. It will print false as a and b are equal but not referring to a same object..... Video 2 baar dekhne pe samjh aaya...
@mohammedsabaajom248
@mohammedsabaajom248 2 жыл бұрын
a = [6,4,"34"] b = [6,4,"34"] print (b is a) # output : False because we just keep the value same.
@chhotastatus491
@chhotastatus491 Жыл бұрын
a = [6,9,"365"] b = [6,9,"365"] print (b is a) Ans will be - False - coz both a and b is pointing to different list. And also having different locations.
@tanishopdc2582
@tanishopdc2582 4 жыл бұрын
print("The program will return 'False' as we have not done a=b instead we have just coped it but python will treat is as two different list /objects.)
@moviepoint6076
@moviepoint6076 2 жыл бұрын
Task:- a = [6, 4, "36"] b = [6, 4, "36"] print(b is a) after run - False
@atinverma6232
@atinverma6232 3 жыл бұрын
i am also thinking about this question before listening you question and i appreciate your question
@MrBraintastic
@MrBraintastic 3 жыл бұрын
False aayega
@angadsingh6478
@angadsingh6478 3 жыл бұрын
damn question
@indiankidscoder8190
@indiankidscoder8190 3 жыл бұрын
task - sir *false* output aayega kyonki b aur a same object ko point nahi kar rahe hai, bhale hi dono ki value same hai but object alag - alag hai so output *false* hi aayega
@tanishajain2341
@tanishajain2341 3 жыл бұрын
It will return False as a and b holds different memory locations and so doesn't point to the same object
@anubhavraj7309
@anubhavraj7309 3 жыл бұрын
a = [6, 4, "34"] b = [6, 4, "34"] print( b is a ) >> output is false Reason : This is because both refer to different list with different memory location
@mayurthorat512
@mayurthorat512 4 жыл бұрын
a == b true a is b false Nd awesome vdo series ja rahi hai harry bhai thnxx so much keep it up gbu 👍❤️
@movietime6013
@movietime6013 4 жыл бұрын
Bhai task ka answer :- False as they are not pointing to the same object par agar print(a==b) will be "True" ayega
@thoropyt9955
@thoropyt9955 Жыл бұрын
print(b is a) return False because b and a are not come a same object
@jackdarcy2264
@jackdarcy2264 4 жыл бұрын
4:20 It will print False
@sangamchaurasiya9797
@sangamchaurasiya9797 4 жыл бұрын
print(a is b) would be False because both list objects are pointing to the different references.
@MuhammadAsadSeo
@MuhammadAsadSeo 5 ай бұрын
Task:- a = [6, 4, "36"] b = [6, 4, "36"] print(b is a) Output will be False Because Values of a and b is same But identity are Not.
@engineerbhai7642
@engineerbhai7642 5 жыл бұрын
You are great and Bestcoder
@rohanbeast3381
@rohanbeast3381 3 жыл бұрын
it will print False as whether we have made their value same, but they are not pointing the same object.
@sinchan18
@sinchan18 3 жыл бұрын
Task ans. False Because memory I'd is different for both variable.
@pinkymehta4068
@pinkymehta4068 4 жыл бұрын
a == b is true a is b is false (it will return False both are different objects but have same values and both values resides in different memory locations)
@AkhileshKumar-nx9mr
@AkhileshKumar-nx9mr 3 жыл бұрын
return False---->immutable object references have the same id and mutable objects like lists have different ids. and list is mutable objects so it return 'false'
@muhammadnajamulislam2823
@muhammadnajamulislam2823 6 жыл бұрын
it will return False both are different objects but have same values and both values resides in different memory locations
@libinTom
@libinTom 2 жыл бұрын
Thanks millions Harry.
@gandharphansalkar5319
@gandharphansalkar5319 3 жыл бұрын
The answer is of question is No, it will not print 'True' it will print 'False' as it is not the same copy of 'a'. 'b' is a new variable but with same list.
@harshitachaurasia1246
@harshitachaurasia1246 4 жыл бұрын
Returns false due to different memory allocation but same value
@coderavi2498
@coderavi2498 4 жыл бұрын
A=[6,4,"34"] B=[6,4,"34"] Print (b is a) O/p >: False
@RahulSharma-bo5jc
@RahulSharma-bo5jc 4 жыл бұрын
Task Output : False Because both are not referencing to the same list as two separate lists are created.
@darshanbothra2673
@darshanbothra2673 4 жыл бұрын
Thanks Harry Bhai
@sanketsuryawanshi
@sanketsuryawanshi 4 жыл бұрын
Thx sir👍👍
@sarojbhati7006
@sarojbhati7006 3 жыл бұрын
4:21 It will be false as a and b are different lists with same values in them
@noumanali6911
@noumanali6911 5 жыл бұрын
Answer=False Because a is a seperate list and b is a seperate list. With same values
@NKDMUSIC
@NKDMUSIC 3 жыл бұрын
# task a = [6,4,"34"] b = [6,4,"34"] print(a is b) ans = fales
@abhaygupta7347
@abhaygupta7347 5 жыл бұрын
Great Video..🎯
@TrixTipsFix
@TrixTipsFix 4 жыл бұрын
False Example(is): Do insaan agar same to same hain per apas main bhai nahi hain to "False" lekin agar wo bhai bhi hain(same parents) aur same to same bhi to "True" ho ga
@sarthakkhare4600
@sarthakkhare4600 4 жыл бұрын
Sir it will print false because the only the values are same not the variables...
@arpitagec9
@arpitagec9 6 жыл бұрын
Bro, plz cover database connectivity in python with oracle SQL,SQL server etc. I really want you to explain since I could not get it
@kunalrathore7402
@kunalrathore7402 2 жыл бұрын
Yes sir plz do this I am aslo waiting for this for a long time Hope you will make video on this also sir @codewithharry
@NimeshSharmanimeshns04
@NimeshSharmanimeshns04 4 жыл бұрын
Finally, the video I wanted.
@qurbannoor9968
@qurbannoor9968 Жыл бұрын
a = [6, 4, "34"] b = [6, 4, "34"] print (b is a) Output False
@ahmarshayan9619
@ahmarshayan9619 Жыл бұрын
Answer is false because b is a completely new list even though it's value are same as that of a So if we print b is a Then it will show false
@sikandarkumar7563
@sikandarkumar7563 4 жыл бұрын
Task answer Is lagaoge to false return krega == Lagaoge to true return krega
@dakshgarg775
@dakshgarg775 4 жыл бұрын
Sir false hoga kyonki vo dono although same value hold karte hain par alag objects hain
@vinodshet345
@vinodshet345 3 жыл бұрын
True print karega kuki vo dono same hai aagr valu bhi dekhi aje or reference bhi dekha jaee..
@sherpurgovtvictoriaacademy1338
@sherpurgovtvictoriaacademy1338 3 жыл бұрын
Really cool
@bugsfounder
@bugsfounder 3 жыл бұрын
# Task: a = [6, 4, "34"] b = [6, 4, "34"] print(b is a) # FALSE BECAUSE B IS NOT REFERS TO A OR A IS NOT REFERS TO B BOTH ARE TWO DIFFERENT OBJECTS print(b == a) # TRUE BECAUSE BOTH OBJECTS HAS SAME VALUE
@princetanwar5694
@princetanwar5694 4 жыл бұрын
Task ans -> false because a and b is not referencing the same object
@abhaygupta7347
@abhaygupta7347 5 жыл бұрын
Output will be False as they are pointing to different object having different memory location..
@sanketh768
@sanketh768 4 жыл бұрын
is this applicable only for list? # it looks like its not applicable for normal variables a=1 b=a d=1 print(a==b) print(a==d) a=2 print(b) # b value is not changing print(a is b) print(d is a) # not supposed to return true since d is a new variable and not pointing to a or b Can someone confirm?
@tangocharlie366
@tangocharlie366 4 жыл бұрын
thanks bro for your hard effort.
@poisegaming2448
@poisegaming2448 3 жыл бұрын
bhaiaya false print karega kyuki b ki jo list woh ditto copy hai a ka iska matlb yeh nhi hia ki b aur a ek hi list ko point kar rhe hai isliye false print hoga
@rohansengupta667
@rohansengupta667 4 жыл бұрын
Task : False print hoga . value same hain but reference alag hain ,
@uniqueghost2294
@uniqueghost2294 3 жыл бұрын
ouput: Fasle Hoga since values tho same hai but we are using 'is' and reference i.e. memory location different hai
@maowarisa3516
@maowarisa3516 3 жыл бұрын
They are two same value list at different memory location so that it will return False
@sajjadmazhar8390
@sajjadmazhar8390 4 жыл бұрын
Will print false. Now please explain this, >>> a=2 >>> b=2 >>> a is b This returns true, why?
@AllinOne-vd9oy
@AllinOne-vd9oy 6 жыл бұрын
False, Because memory location of a and b is different. And is identifier check memory location of both variable.
@siddharthraj4569
@siddharthraj4569 2 жыл бұрын
The output will be false,since both have same values but pointing to different values.
@kanuwebmedia8250
@kanuwebmedia8250 6 жыл бұрын
Boss jai ho
@kaustubh_ramteke_07
@kaustubh_ramteke_07 2 жыл бұрын
awesome
@soumyanamdeo2347
@soumyanamdeo2347 4 жыл бұрын
items of list a and list b are same but it doesn't meant that both are same ...... the result will be false
@abhinavchoudhary6849
@abhinavchoudhary6849 3 жыл бұрын
Sir task jo hai vo Uska answer false ayega Because vo same to hai but dono ke object alag alag hai
@anishjain8096
@anishjain8096 6 жыл бұрын
Thank you bhai
@aasthahimthani7403
@aasthahimthani7403 2 жыл бұрын
output:False kyunki a and b different list ko point kar rahe hai
@vishant898
@vishant898 4 жыл бұрын
Task ans. False becoz a and b ko alag alag assign kiya gya h
@kiranmadake5359
@kiranmadake5359 4 жыл бұрын
Hi harry sir apke python ke sub videos maine dekhe hai and i have learnt a lot mai pehel visual studio 2017 pe windows application me kam karta tha but now i am a good web developer as well maine khud ki ek website bhi kar li hai jo ki mere local host pe iis server pe maine host kar li or uske bad maine web hosting bhi sikh liya jisse ki main khud ki website www.chillernotes.com aur www.stick2web.com host so ur videos are most motivating also have a very simple way of explaining muze ek simple language me aap await aur async kya hota hai aap samjha dete to bohot acha hota
@hritikkaushik8518
@hritikkaushik8518 2 жыл бұрын
a =[6,4,34] b =[6,4,34] print(b is a) It will false
@rahuldogra9045
@rahuldogra9045 4 жыл бұрын
false ,as addresses of 2 variables in memory is different.Hence is keywords checks 2 variables by address only and == by value
@khadimhusen
@khadimhusen 6 жыл бұрын
Thank you
@angadsingh6478
@angadsingh6478 3 жыл бұрын
4:31 ans is false as their values are same but they are two different objects
@TECHFIELDER786
@TECHFIELDER786 3 жыл бұрын
Yes this is true
@epicapitgaming7665
@epicapitgaming7665 4 жыл бұрын
the answer is if 'is' is used then it will return 'false ' else '==' is used then it will return true
@vickynetwork6039
@vickynetwork6039 4 жыл бұрын
#task - False, because a and b are two different objects.
@animeshprasad5268
@animeshprasad5268 6 жыл бұрын
If will print false because a and B although have same data but they have different memory location ? Plz reply am I right or not
@Swarnimshow
@Swarnimshow 2 жыл бұрын
# task: a = [4, 45, "uwu"] b = [4, 45, "uwu"] print(b is a) answer is false because they both are different object
@adarshkhatri993
@adarshkhatri993 3 жыл бұрын
True...
@college6531
@college6531 4 жыл бұрын
False 1)hoga kyun ki dono ki values same hone ke bawajood same variable me store nahi hoga 2) Agar ham dono me se ek variable ki value change karen to agle ki value change nahi hogi ..... Hence proved.......
@m.sameeribnmuhamadizhar9927
@m.sameeribnmuhamadizhar9927 6 жыл бұрын
Hlo harry I wish you ever happy
@talhaali4343
@talhaali4343 3 жыл бұрын
task: it will return false because b and a equal, but are two different objects
@RahulSingh-il6sz
@RahulSingh-il6sz 4 жыл бұрын
The ans is false because the location is different in memory of each list. It can be true for small integer(< 255) for unsigned integer as they are immutable in python.
@maasahebbiustad8514
@maasahebbiustad8514 3 жыл бұрын
it will give true if numbers lies between -5 and 256 (including lower and upper limits)
@epicapitgaming7665
@epicapitgaming7665 4 жыл бұрын
iam watching this series from start to end
@skpandeyg
@skpandeyg 6 жыл бұрын
False hoga kyoki a b se nahi ban raha hae please give me heart
@techzcool
@techzcool 4 жыл бұрын
Is - it can be understand by like: there r twins but from different parents == -twins from same parents
@youngindianchef8207
@youngindianchef8207 4 жыл бұрын
True
@deepakdhiman6341
@deepakdhiman6341 6 жыл бұрын
How to write the output of sum of two numbers into a file with the date and time when code run?
@priyankagarg4526
@priyankagarg4526 2 жыл бұрын
Output will be false because two different lists are located at two different locations
@mandardeshpande2740
@mandardeshpande2740 4 жыл бұрын
b is a false hoga!!!, Kyuki dono me value same hai lekin dono alag objects hai
@shreyanshmishra1685
@shreyanshmishra1685 5 жыл бұрын
It will be false As memory location of a and b are different from each other
@chetak-german-shepherd
@chetak-german-shepherd 6 жыл бұрын
Request you to create a Django tutorial if possible
Please Master These 10 Python Functions…
22:17
Tech With Tim
Рет қаралды 261 М.
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.
Web Developer Roadmap (2025) - Everything is Changing
21:48
CodeWithHarry
Рет қаралды 207 М.
Os Module | Python Tutorials For Absolute Beginners In Hindi #79
14:38
Learn Coding & Get a Job (in 2025) 🔥
16:54
CodeWithHarry
Рет қаралды 772 М.
Top Skills to Learn in 2025
9:31
CodeWithHarry
Рет қаралды 534 М.
Indentation in Python | Python Tutorials for Beginners #lec52
11:27
Jenny's Lectures CS IT
Рет қаралды 68 М.
Python Tutorial: if __name__ == '__main__'
8:43
Corey Schafer
Рет қаралды 2 МЛН
What is For Loop in Python | Data on Repeat | Python Tutorials
18:43
Python for Beginners - Learn Coding with Python in 1 Hour
1:00:06
Programming with Mosh
Рет қаралды 20 МЛН