in the question where we have to write a code to print last line of file : you can use this code also: f=open("1.txt","r") x=f.readlines() print(x[-1])
In the last program, the interpreter would give an error: "local variable 'a' referenced before assignment" To avoid this, before while loop, at line number 3, you'll have add one more line of code as follows: a =' ' and you're all good. :)
sir mera parso board hai , pure saal dhang se nahi padha but aaj aapki videos dekh kr maza aagaya pura syllabus complete krlia and jo coding merko 10th se smjh ni aaya uski aaj clarity hogyi thank you :)))
BHAIYA I KNOW YOU TRYING TO CREATE A BULK BUT PLEASE UPLOAD ALL OF PYTHON ASAP BECAUSE WE HAVE BOARDS,PRACTICALS ,AS WELL AS MAINS RIGHT INFRONT OF US , DON'T HAVE MUCH TIME LEFT HOPE U UNDERSTAND......
Ha sacchi Bhaiya load aaa jata hai python ka plzzzz Bhaiya upload all the video lecture aur Bhaiya plzzz ap chapter start karne se pehele chapter no. Likh diya kijiye plzz easily samaj aaaa jata hai. ...
Hai hi ni na 😑😂tbhi poocha... actually hmari mam alg alg pdf send krri h hr chptr k...and ab mujhe confusion hori h koi bolra h sumita arora koi Preeti arora koi ncert... smjh ni ara m kaunsi lu
@@Insigneon might their advertisement team forgot.....they have an option to whom they will be showing this advertisement like to those on P.C or T.V or mobile phone
You don’t have to put delimiter keyword because the default delimiter is comma itself. Also, you don’t need a loop of .writerow(), you can just pass the nested list in .writerows()
7:32 code is not valid gives error. Corrected code- file=open('data.txt','r') line=file.readlines() last=line[-1] print(last) 11:21 also gives error. Corrected code- def displayword(): a=open('Answer.txt','r') b=a.read() c=b.split() for i in range(len(c)): if len(c[i])>4: print(c[i]) else: continue Or you could just assign and empty variable first like a=' ' While a: Like that but for loop is more easy. Atleast for me.
I also tried the second code on 11:21, the program says local scope a can't be accessed. I think for a while and tried many changes in the code. Final conclusion is this Code:- def Displaywords(): f=open('Lyrics.txt', 'r') a=f.read() L=a.split() for j in L: if (len(j)
there is an error at 2:34 becoz we r opening a file(a) in write mode and trying to use read function in 4th line due to which print(p) will give an error
the question 4 (9:51) I tried the code jo aapne bataaya tha but it showed error so mene khud se ek try kiya and its working completely fine.... def DISPLAYWORDS() : f= open("abc.txt",'r') a = f.read() l = a.split() for i in l: if len(i)
Sir your lectures are very helpful to me cuz mere chance ni the +2 exam cs m pass ho jaunga but at last I found your channel nd I'm very grateful I got 45+30 overall 75/100 nd thankyouhh so so muchh❤❤
For the 3rd question if you want to add file path you can use this code also: a=input("Enter 1st file name: ") b=input("Enter 2nd file name: ") x1='C:\\Users\\SANJU\\Desktop\\'+a+'.txt' x2='C:\\Users\\SANJU\\Desktop\\'+b+'.txt' f1=open(x1,'r') f2=open(x2,'w') l=f1.readlines() f2.writelines(l) f2.close()
Sir please upload more videos i haven't completed my syllabus yet and i also don't know the syllabus exactly. I am only following you please make more videos 🙏
10:52 Sir you have done a lot of errors while writing this code. The correct code is given below: c=open('lyrics.txt', 'r') a=True while a: a=c.readline() b=a.split() for i in b: if len(i)
above the loop take a= " "(space or empty string) when u write while a: (you mean to say while there is a character the loop will keep going and when u reach the end, there is no characters so the while condition becomes false and loop terminates.
can you please make videos in english sir? You have many students from south india as well,trying to learn from your videos including me. and we find it really hard with hindi
Bhaiya please upload more videos I really need them in my school tomorrow is my cs exam and I depended on your videos but you didn't upload any lecture of cs for a long time due to which i haven't studied well .
@apni kaksha Bhaiya aapne reading of a binary file me exception handling jaise use of try & except blocks bataye nahi hai Bhaiya pls include this also🙏
Guys please say them to do Programming in python idle. It would be helpful in practicals also as we will know how to do programming. Please anyone say this to aman bhaiya😭.
No one
Literally no one:
Harsh bhaiya - Parle-G ka achaar!!!
to display words whose length less than 4 :
fp=open('blablabla'.txt','r')
words=fp.read().split()
for i in words:
if len(i)
3:20 - CSV FILES
4:00 - Reading a CSV FILE
4:45 - writing a csv file
5:45 - Practice time
9:50 -Q3 imp
Who is wathching this right now for tomorrow's exam😅😂
✋✋Ez
Mehhh 😂
Wahh
Meee
1 night - whole syllabus
in the question where we have to write a code to print last line of file :
you can use this code also:
f=open("1.txt","r")
x=f.readlines()
print(x[-1])
genius
@@techboyvikrant9048 Bhai yaad dila dia tune ki mene kabhi comment Kia tha , tab me 12th me tha , Aaj me IIT Kharagpur me hu btech in cse
@@xperthighlight topper
@@akarsh_24 😂😂nahi bhai me nahi hu iit me
3:33 nobita still getting zero 🤣🤣🤣
7:37 my method
a=open('data.txt','r')
b=a.readlines()
print(b[-1])
a.close()
thx bro i tried thi one prac but was giving error but by your method i got solution thank you very much
In the last program, the interpreter would give an error: "local variable 'a' referenced before assignment"
To avoid this, before while loop, at line number 3, you'll have add one more line of code as follows:
a =' '
and you're all good. :)
are you mayank kumar? st. marks school?
Yes you are right as I have tried the program and it is giving error.
Thanku bhaiyaas and didis for changing the future of India.... guiding us towards a super power india (jbhi hoga)
Kaunsi book h python ki class 12 apki
@@nishimahara9126 sumita Arora
@@nikhillodhi7427 ok thanks
Sumita Arora h bhai..
sir mera parso board hai , pure saal dhang se nahi padha but aaj aapki videos dekh kr maza aagaya pura syllabus complete krlia and jo coding merko 10th se smjh ni aaya uski aaj clarity hogyi thank you :)))
Haan bhai Mera bhi hain exam
samjh aaya?
@@debapriyahazra
@@tripuytshorts3392 haan
to print last line:
fp=open('blablabla.txt','r')
lines=fp.read().splitlines()
lastline=lines[-1]
print(lastline)
or
f=open("yes.txt",r)
a=f.readlines()
print(a[-1])
BHAIYA I KNOW YOU TRYING TO CREATE A BULK BUT PLEASE UPLOAD ALL OF PYTHON ASAP BECAUSE WE HAVE BOARDS,PRACTICALS ,AS WELL AS MAINS RIGHT INFRONT OF US , DON'T HAVE MUCH TIME LEFT HOPE U UNDERSTAND......
Ha sacchi Bhaiya load aaa jata hai python ka plzzzz Bhaiya upload all the video lecture aur Bhaiya plzzz ap chapter start karne se pehele chapter no. Likh diya kijiye plzz easily samaj aaaa jata hai. ...
Kaunsi book h Python ki apke school m
@@nishimahara9126 sumita arora...... Hai hamare school ke.... Apki koonsi hai?
Hai hi ni na 😑😂tbhi poocha... actually hmari mam alg alg pdf send krri h hr chptr k...and ab mujhe confusion hori h koi bolra h sumita arora koi Preeti arora koi ncert... smjh ni ara m kaunsi lu
@@nishimahara9126 oooo.....nhi hamara sumita hai.....by the way kaunsi school hai apki????
3:54 WHO ELSE NOTICED NOBITA=0 MARKS 😂😂😂
Tumhara billa billa mera billa doreamon 😁😜
@@darshanxarijit 🤣🤣🤣
This brave showing his ads like: wow! You really let this add in?😂🤦🏻.... Bro u won't be able to advertise if it wasn't for this ad 🤣
Plus who the heck watches yt via a browser on a smartphone.
Like wtf do you want us to do mate...
@@Insigneon they want us to use there browser
@@OmTheGreat based bro
But I like brave for not showing ads 😂
@@Insigneon might their advertisement team forgot.....they have an option to whom they will be showing this advertisement like to those on P.C or T.V or mobile phone
Who is watching this right now for tomorrow's exam 😂😂
😁
Meeeee
Not me dah
Ha na
Yesn't
sir please upload the next lecture because my preboard will be start
15 January
Aman bhaiya,, please bata do na ki aap Physics ki remaining chapter ki notes kab denge 📚📚please please reply🙏🙏 agar kisi ko pata hai please reply 🙏🙏🙏
Hmm bhaiya
Guys jyda se jyda like kro.. taaki Aman bhaiya dekhe
Preboard Shuru ho gaye please physics notes
Plz upload remaining physics notes bhaiya
Yes bhaiya please tell
You don’t have to put delimiter keyword because the default delimiter is comma itself. Also, you don’t need a loop of .writerow(), you can just pass the nested list in .writerows()
Okay
3:51 Nobita supremacy!! love the way you teach sir
Physics ke notes updload kardo pls optics and modern
Thank you bhaiya .... It's helping a lot.
7:32 code is not valid gives error.
Corrected code-
file=open('data.txt','r')
line=file.readlines()
last=line[-1]
print(last)
11:21 also gives error.
Corrected code-
def displayword():
a=open('Answer.txt','r')
b=a.read()
c=b.split()
for i in range(len(c)):
if len(c[i])>4:
print(c[i])
else:
continue
Or you could just assign and empty variable first like
a=' '
While a:
Like that but for loop is more easy. Atleast for me.
Very nice bro.
I also tried the second code on 11:21, the program says local scope a can't be accessed.
I think for a while and tried many changes in the code.
Final conclusion is this Code:-
def Displaywords():
f=open('Lyrics.txt', 'r')
a=f.read()
L=a.split()
for j in L:
if (len(j)
@Nirmit Kun Nice
@@itachi03537 eren yeager
3:19 he literally gave Nobita "0" marks 😂😂
In 7:12 you need to define variable 'a' beforehand else it will give NameError as a is not defined.
Correct
This guy really loves Parle-G and Tindey. 😆🤣
At 3:56 marks of Nobita😁😁
How realistic bhaiya😅
I like the fact that a fictional character seems *realistic*
5:56
But now the suitable line is, Ek tha raja
Ek thi Rani, alg thi caste, khtm Kahani 🙄
4 ghante me exam hai, moye moye
Bhai 1 ghante me hai
there is an error at 2:34 becoz we r opening a file(a) in write mode and trying to use read function in 4th line
due to which print(p) will give an error
Can you please tell me how to rectify the error
Sir please upload all lectures and completed MySQL ASAP.
We are having aur preboards in front of us🙏🙏🙏🙏
Eat well, sleep well, study well.
With a slow speed of speaking this lecture can be better than school lectures
10:15 wo din door nhi jab hamare bacche bhi python padhenge...aur "file ka name" hamare poorvaj *BINOD ka naam denge😂👍🏻
the question 4 (9:51) I tried the code jo aapne bataaya tha but it showed error
so mene khud se ek try kiya and its working completely fine....
def DISPLAYWORDS() :
f= open("abc.txt",'r')
a = f.read()
l = a.split()
for i in l:
if len(i)
Term 1board exam 4.06 am 7 hr to go....🙂 21 dec
Thanks a lot harsh bhaiya ..😊😊
Thanks bhaiya you are the best😎
Bro I'm watching this right now for tomorrow board final exam
looks like we are on same boat
3:34 sir really knows which cartoon character has best and worst academic background 😂😂😂
Nitro Your Speed 🚅
We have to fight with Thanos who killed our Vision.⚡
Kids: aam ka aachar...
Men: neembu ka aachar..
Legend: tinde ka aachar...
Legend pro max: Parle-G ka aachar...
😂😂😂😂🙌🙌🙌
Sir your lectures are very helpful to me cuz mere chance ni the +2 exam cs m pass ho jaunga but at last I found your channel nd I'm very grateful I got 45+30 overall 75/100 nd thankyouhh so so muchh❤❤
6:55 this code is more efficient
f=open("file.txt","r")
l=f.readlines()
print(l[-1])
hn bhai while a mai error hai last question ka bhi source code da diyo bhai hlp hojyagi meri
while a wala code galat hai. telling 'a' is not defined.
awesomeness has no ending😄😄😄
Sir please upload next lecture 💙💙💙💙
Alternate answer for last ques is
def displaywords():
f=open('lyrics.txt','r')
p=f.readlines()
for i in p:
j=i.split()
for k in j:
if len(k)
When will class 12th physics volume 2 notes will be uploaded?
Thanks sir 👐
Mai toh 4:40 pe dekh raha hu 😅
Agla lecture kb aayga ..
f=open("C:\\Users\\Lenovo\\Desktop\\source.txt")
a=f.readline()
while a:
print(a)
a=f.readline()
correct code for qusetion 2.
They did my boi Nobita dirty 3:20
Aplog Notes kyo nhi upload karte ho😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭🙄🙄😭
Abe to copy me likhona
Kb tk dussre ke bll me chaloge😑😑😑
@@shamsaarize5349 Abe gandu notes agar mil jata toh...... video ko pause ⏸️ karke nhi likhna padta......
@@chandankrmahato2202 bro khud se banyaa hua notes sabse best hotee hee
@@chandankrmahato2202 OP
@@chandankrmahato2202 well done bhai
For the 3rd question if you want to add file path you can use this code also:
a=input("Enter 1st file name: ")
b=input("Enter 2nd file name: ")
x1='C:\\Users\\SANJU\\Desktop\\'+a+'.txt'
x2='C:\\Users\\SANJU\\Desktop\\'+b+'.txt'
f1=open(x1,'r')
f2=open(x2,'w')
l=f1.readlines()
f2.writelines(l)
f2.close()
Sir please upload more videos i haven't completed my syllabus yet and i also don't know the syllabus exactly. I am only following you please make more videos 🙏
Pls increase the frequency of lectures of cs
Thank you so much Bhaiyaa... Pls aage k Lec bhi daal do python k pls... Pls... Bhaiyaa 😵😥
Pre boards has already started just complete the lectures soon please 🙏🙏
10:52 Sir you have done a lot of errors while writing this code. The correct code is given below:
c=open('lyrics.txt', 'r')
a=True
while a:
a=c.readline()
b=a.split()
for i in b:
if len(i)
thanks, bhaiyya...
Ab please marathon me syllabus revision complete kara do! 🙏🏼🙏🏼
Boards in may
Please upload SQL Lectures also
1:15 coding ka achhar.
Who is watching just before a hour of Exam 😂😂😂😂😂😂❤😂❤😂😂😂😂❤😂
watching this before
12 hours to go exams cs............ :)
Bhaiyaa, kya aap sab chapter ke definitions bhi notes me include kar sakthe hai? Thank you for ur effort ❤️
Kaunsi book h tunhare school m python ki?
If you don't want to close file use:
with open(filepath,mode) as fileobject:
Statement(s)
Awesome Sir :) 🔥🙏✌👏😇👍😎👌🤘
the code of the first question will give an error because in the first iteration the value of a is not defined.
you caught it
F=open('data.txt','r')
s1= F.readlines()
s2=s1[-1]
print(s2)
bhaiya 7:33 pe error ayega because before going in while loop, 'a' must be defined which u defined inside the loop.
you are right
above the loop take a= " "(space or empty string)
when u write while a: (you mean to say while there is a character the loop will keep going and when u reach the end, there is no characters so the while condition becomes false and loop terminates.
Last line print nhi ho rahi hai
Can You Please Upload One more Video LECTURE ON PYTHON CONNECTIVITY WITH MySQL, AS IT IS ALSO IN OUR COURSE
No bro
sir , in the last question, while running the code it shows the error,
"while a:
UnboundLocalError: local variable 'a' referenced before assignment"
Ek tha Raja
Ek thi raani
Do the bacche...
Raja Mar gya ladae me..
Raani Mar gai kadai me..
Bacche Mar gai Padhai me🙂
Thank you so much sir ♥
Abhi 2 ghante me exam h 😂😂😂,lekin no Darr when bhaiya is here
a = (time(2:05), "opening file 'File1.txt 'with mode = write " )
b = (time(2:16), "applying read on File1.txt")
😝😝😝
a != b == hypocrisy op 😅
3:55 accurate marks at the end.
bhaiya aage ka jaldi upload kar dijiye please and thank you for all these videos
Bhai aaj exam hai😢
Same😂😂
Same bro
Ch ni horaa smj hini ar na ssb smjnRa kya kru 😢😢
@@simranverma289 chor de bhai jaa ke so jaa abb kuch nahi kar sakta😂
@@sharadmishra2186best option
can you please make videos in english sir? You have many students from south india as well,trying to learn from your videos including me.
and we find it really hard with hindi
Switch on the sub titles. I know it's tough for you guys. All the best.
@@devanshchaudhary4098 no subtitles brother
3:19 nobita : gajab bejjati hai
sir plsease conduct the mcqs session on python class 12 for term 1........ sir pls help sir
Lol watching this on the way to exam hall
Upload more videos Aman bhai
You are our hope for Class-12th PYTHON
@Apni Kaksha
Really thankful to Aman Bhaiya.. Keep growing and stay motivated..!!
Bhaiya please upload more videos
I really need them in my school tomorrow is my cs exam and I depended on your videos but you didn't upload any lecture of cs for a long time due to which i haven't studied well .
7:24, f.readlines karke print(L[-1]) chalega?
chatgpt 🤡
@@surferr jab sare queries programs chatgpt se le sakte h fir ham padh kyu re h .............bc education system hii kharab h
@@Jatin.pandattt education system nhi, it's just ai, isliye log ml krre h zyada
@apni kaksha
Bhaiya aapne reading of a binary file me exception handling jaise use of try & except blocks bataye nahi hai
Bhaiya pls include this also🙏
Aage ke videos bhaiya?????? 3 weeks ho gye aapko python ke video upload kare🥺
Pta nhi yrr kb ayegi aage ki videos🙄
Sir plz upload next chapter 🙏🙏
Ty sir app itni mehnat kar rahe ho
Bhaiya pls upload remaining lectures too. 🙏🏻
Bhaiya while a: me 'a' to defined hi nhi tha tab to error ho jaega na?
Btw thank you so much for all videos
Aman Bhai please try finishing computer syllabus before our practicals...I haven't touched our school book I've only been following your videos...
Guys please say them to do Programming in python idle. It would be helpful in practicals also as we will know how to do programming. Please anyone say this to aman bhaiya😭.
Bhaiya d block ke notes upload kar do plz..
Already h
@@RohitRoy-fl3cm kaha
2 april😂
Who noticed nobita getting zero again
🙁🙁HE IS THE ONLY HUMAN THERE
Waiting for next lecture bhaiya please provide that asap
3:20 - CSV FILES
4:00 - Reading a CSV FILE
4:45 - writing a csv file
5:45 - Practice time
9:50 -Q3 imp
waiting for next lecture