Hello all This one the best python basic lecture you will ever get, In the entire video she never asked for subscribe or like. Let’s encourage her to do more courses like this and help crores of students and learner’s. Keep up the good work Shraddha and keep on helping people.
There's nothing wrong to ask from the viewers to subscribe to their channel as it can be someone's main source of income and without being so mean we can listen and do that thing so
@@neonblade209 I want to learn machine learning thats why I chose python so there is any way you can tell where I can learn DSA because leetcode and all other platforms doesnt start from basic It would be great help if you help me with this
The r+ does not always add the data at the beginning. its totally depends where the cursor is like if we use the read command and then write so in this case after reading data the cursor will be in the end and if then we use the write command then the new data will be added to the end of file: For example in this case: f = open("test.txt" , "r+") content = f.read() f.write("john" ) f.close() : now in this case "john" will be added to the end of file. so remember the cursor is not always in the beginning in r+ mode its totally depends what you have done before that line of code. Happy coding😊
00:01 Today we will cover Chapter Seven about file operations. 02:07 RAM is volatile memory and not suitable for permanent storage 06:02 Using physical files in day-to-day operations 08:25 Opening a file in read mode returns a text IO wrapper 13:18 Understanding file reading modes 15:23 Reading a file and printing its contents 19:13 Appending data to a file in A mode 21:17 Differences between different modes 25:09 Different file modes in Python: Read Plus, Write Plus, Append Plus 27:19 Using the 'with' syntax in Python automatically closes the file 31:48 We can delete any file by using the remove function in the os module. 34:24 Replace Java with Python in a file using the replace method. 38:59 Write a function to find the line number of the word 'learning' in a file. 41:02 The code checks if a word exists within a given data string and prints the line number if it does. 45:28 Extract individual numbers from a string and convert them to integers 47:20 The code splits a string of numbers separated by commas and prints them individually. Crafted by Merlin AI.
def replace("Java" , "python"): with open ("practice2.txt", "r" ) as f : date= f.read() n_data= data.replace("Java" , "python" ) print(n_data) with open("practice2.txt", "w"): f.write(n_data)
One thing to mention, that the 'in' operator in Python checks for a substring match, meaning it will return True even if only part of the word "learning" appears in the text. For example, if the text contains "lear" or any character that the word starts with, the code will still print the word is "found". At 41:37.
There is one thing Ma'am Shradha forgets to mention is that if anyone passes the path of a text file to the first parameter of the open function, so if you just copy and paste the path as it is in the double quotes, Python will give an error because in the path there are back slashes (\), and python treated back slashes as an escape sequence character. So to fix this, there are many options, but I find these two easy; either u can put r before the first double quote and so python will treat the path as a raw string or u can replace all single back slashes with double back slashes(\\) and so python will treat this as a normal back slash rather then treating it as a escape sequence character.
I wanted to point out that while the code used to import data from another file and count all the even numbers (without using the split function) was functioning, there is a serious bug. The issue is that you will never get the ending value because there is no comma to separate it. This can be fixed with a little tweak, but I thought it's good if I let everyone know.
37:07 WAF to find all the occurrences of any given word. def check_for_word(word): line_no=1 occurrence=[] with open("practice.txt","r") as f: for line in f: if word in line: occurrence.append(line_no) line_no+=1 if occurrence: print(f"the word {word} was found at lines:, {occurrence}") else: print(f"the word {word} was not found in the file") check_for_word("Python")
key topics with timestamp :------> 00:01 Today we will cover Chapter Seven about file operations. 02:07 RAM is volatile memory and not suitable for permanent storage 06:02 Using physical files in day-to-day operations 08:25 Opening a file in read mode returns a text IO wrapper 13:18 Understanding file reading modes 15:23 Reading a file and printing its contents 19:13 Appending data to a file in A mode 21:17 Differences between different modes 25:09 Different file modes in Python: Read Plus, Write Plus, Append Plus 27:19 Using the 'with' syntax in Python automatically closes the file 31:48 We can delete any file by using the remove function in the os module. 34:24 Replace Java with Python in a file using the replace method. 38:59 Write a function to find the line number of the word 'learning' in a file. 41:02 The code checks if a word exists within a given data string and prints the line number if it does. 45:28 Extract individual numbers from a string and convert them to integers 47:20 The code splits a string of numbers separated by commas and prints them individually. thankyou
code for the problem to find learning in line with line index of a file 'with open('practice.txt', 'r') as file: n = 0 for line in file: n += 1 if 'learning' in line.strip(): print('learning found in line', n) else: continue'
I am from Pakistan and i am learning frontend development by watching your tutorial. you are doing absolutely great work. html css js ho gae ab react.js ka course kab aey ga
32:57 Practice Question 1 ---------> with open("practice.txt", "w") as f: f.writelines("Hi everyone, We are learning File I/O using Java. I like programming in Java.")
Loving your content mam, I've been learning from you for so long and you make it very easy to grab a good hold on the concept, please if possible, extend this series by adding data analysis videos using numpy pandas, I'm a data enthusiast and building a career in data field. It'll be really helpful if you can add these concepts as well, and as you said you also wish to give a tutorial on machine learning, I will definitely wait for your ML videos.
write a program to convert the sequence of number into type of integer ----------- with open('read_num.txt', 'r') as f: read_file = f.readline() split_stream = read_file.split(",") int_converted_val = [] for num in split_stream: number = int(num) int_converted_val.append(number) print(int_converted_val)
If we go with the traditional method, what if the last no after comma is even no. In that case last no will not come in num bcoz there is no comma after that & we can't check even for it Ps: last ques of the video
WAP to find the word which we find the I/O streamed file ------------------- def fun(): with open('read_file.txt',"r") as f: word = 'dogs' data = True line = 1 while data: data = f.readline() if(word in data): print(line) return line += 1 fun()
some pls help me when i write replace at 36:20 it is showing new_data = data.replace("Java", "Python") ^^^^^^^^^^^^ AttributeError: 'builtin_function_or_method' object has no attribute 'replace' pls help me
def check_for_line (n): line_no = 1 with open("practice.txt", "r") as f: for line in f: if line.find (n) != -1: print (line_no) return line_no += 1 return ("not found") print(check_for_line("hi"))
M i the only 1 whoes first code is not working. I made a file naming demo.txt Then write f=open ("demo.txt") data=f.read () Print(data) Print(type(data)) But in terminal it prints only type which is str but no data
Ma'am if I run the "write command in VScode " it is not working. What should I do? Pls help... when I run the write command the text in the txt file is not overwriting as you said.... the text remains the same. Pls help..... 🙏🏽🙏🏽
def search(): with open('practice.txt','r') as f: line1=f.readline() line2=f.readline() line3=f.readline() line4=f.readline() if 'learning' in line1 or line2 or line3 or line4: print('found')
Q1) is there a solution to avoid print one blank line after reading any one line at a time due to impact of implicit ' ' at the end of the string in line1?
mam , while replacing the word java to python , and after that the file should be overwritten, but when i was writing the code the file is not being overwritten but the new file is being created , which should not happen right?how should i come over this error.
00:01 Today we will cover Chapter Seven about file operations. 02:07 RAM is volatile memory and not suitable for permanent storage 06:02 Using physical files in day-to-day operations 08:25 Opening a file in read mode returns a text IO wrapper 13:18 Understanding file reading modes 15:23 Reading a file and printing its contents 19:13 Appending data to a file in A mode 21:17 Differences between different modes 25:09 Different file modes in Python: Read Plus, Write Plus, Append Plus 27:19 Using the 'with' syntax in Python automatically closes the file 31:48 We can delete any file by using the remove function in the os module. 34:24 Replace Java with Python in a file using the replace method. 38:59 Write a function to find the line number of the word 'learning' in a file. 41:02 The code checks if a word exists within a given data string and prints the line number if it does. 45:28 Extract individual numbers from a string and convert them to integers 47:20 The code splits a string of numbers separated by commas and prints them individually.
Hello all
This one the best python basic lecture you will ever get,
In the entire video she never asked for subscribe or like.
Let’s encourage her to do more courses like this and help crores of students and learner’s. Keep up the good work Shraddha and keep on helping people.
what do you think after completing this lectures what should we do , is there any other videos to practice them and become pro in this .
There's nothing wrong to ask from the viewers to subscribe to their channel as it can be someone's main source of income and without being so mean we can listen and do that thing so
Mam! this line is very motivational for me that you mentioned in start that "All power is within you you can do anything and everything"
Shradha di please cover all the Topics from 0 to 100 and please start DSA with Python 🙏
better to start DSA with Java or c++, becoz u will get more resources in java and c++ , dont start DSA with python
@@neonblade209 AI and machine learning is better un python i guess
@@KumarHarsh-qu3fk you're right
@@neonblade209 I want to learn machine learning thats why I chose python so there is any way you can tell where I can learn DSA because leetcode and all other platforms doesnt start from basic It would be great help if you help me with this
@@CraftAndCodee search for codebasics DSA playlist
The r+ does not always add the data at the beginning. its totally depends where the cursor is like if we use the read command and then write so in this case after reading data the cursor will be in the end and if then we use the write command then the new data will be added to the end of file: For example in this case: f = open("test.txt" , "r+")
content = f.read()
f.write("john" )
f.close() : now in this case "john" will be added to the end of file. so remember the cursor is not always in the beginning in r+ mode its totally depends what you have done before that line of code. Happy coding😊
00:01 Today we will cover Chapter Seven about file operations.
02:07 RAM is volatile memory and not suitable for permanent storage
06:02 Using physical files in day-to-day operations
08:25 Opening a file in read mode returns a text IO wrapper
13:18 Understanding file reading modes
15:23 Reading a file and printing its contents
19:13 Appending data to a file in A mode
21:17 Differences between different modes
25:09 Different file modes in Python: Read Plus, Write Plus, Append Plus
27:19 Using the 'with' syntax in Python automatically closes the file
31:48 We can delete any file by using the remove function in the os module.
34:24 Replace Java with Python in a file using the replace method.
38:59 Write a function to find the line number of the word 'learning' in a file.
41:02 The code checks if a word exists within a given data string and prints the line number if it does.
45:28 Extract individual numbers from a string and convert them to integers
47:20 The code splits a string of numbers separated by commas and prints them individually.
Crafted by Merlin AI.
thanks bhai
please create a series for AI, ML && Neutral Networks and cover all the topics.
Ys ma'am please 🥺
Ys ma'am please 🥺
yes ma'am please create the playlist for ai ,ml and neural network
Yes ma'am
comment on apnacollege for this letest video
36:42
def replace(old_string, new_string):
with open("practice2.txt","r") as f:
data=f.read()
n_data = data.replace(old_string, new_string)
print(n_data)
with open("practice2.txt","w") as f:
f.write(n_data)
replace("Java","Python")
def replace("Java" , "python"):
with open ("practice2.txt", "r" ) as f :
date= f.read()
n_data= data.replace("Java" , "python" )
print(n_data)
with open("practice2.txt", "w"):
f.write(n_data)
One thing to mention, that the 'in' operator in Python checks for a substring match, meaning it will return True even if only part of the word "learning" appears in the text. For example, if the text contains "lear" or any character that the word starts with, the code will still print the word is "found". At 41:37.
There is one thing Ma'am Shradha forgets to mention is that if anyone passes the path of a text file to the first parameter of the open function, so if you just copy and paste the path as it is in the double quotes, Python will give an error because in the path there are back slashes (\), and python treated back slashes as an escape sequence character. So to fix this, there are many options, but I find these two easy; either u can put r before the first double quote and so python will treat the path as a raw string or u can replace all single back slashes with double back slashes(\\) and so python will treat this as a normal back slash rather then treating it as a escape sequence character.
So awesome nice video by you Shradha Khapra madam, Its so awesome
The example of Shaktimaan was the best example 👌.
for those who not getting that where to write pip install command please write that command in your terminal 31:49 and all set
I am facing the issue in starting, demo.txt file does not print , only print the type demo.txt, could you please tell me how to fix this problem?
Thanks didi from bottom of my heart for this awasome python series.
0:13
It's really helping for students. The way you are providing knowledge in an easy and simple way.
this series is most helpful for me ..thanks to shradhaa mam
I wanted to point out that while the code used to import data from another file and count all the even numbers (without using the split function) was functioning, there is a serious bug. The issue is that you will never get the ending value because there is no comma to separate it. This can be fixed with a little tweak, but I thought it's good if I let everyone know.
Thankyou mam for this amazing vedio , i understood everything
Mujhe kafi mn tha, python sikhne ka , ye bahut hi unique vedio hai Mam
Alhumdullilha 💖
Satisfied
10:24
mam string is not printing only the type is printing
same problem with me
same problem with me
bhai log
minimize kar ke karne ke bad ho raha hai
with every change in demo.txt
i ahve to Minimize VSC
@@BowlNest bhai log
minimize kar ke karne ke bad ho raha hai
with every change in demo.txt
i ahve to Minimize VSC
@@RahulSingh-ml9hg bhai log
minimize kar ke karne ke bad ho raha hai
with every change in demo.txt
i ahve to Minimize VSC
very intellgently teaching python. I really admire her, as I have seen one of other tutorial but that was insufficient and incomplete. Nice
Thanks a lot maam for teaching us simply and clearly, in an understandable way. Hare krishna !
thank you amazing lecture yet again, last part practice question was amazing cleared all my doubt but need to practice more
28:21 shaktimaan & gangadhar
Understood everything but at 48:20 the last number in the data isn't printed as there was no "," after the no. 101
37:07
WAF to find all the occurrences of any given word.
def check_for_word(word):
line_no=1
occurrence=[]
with open("practice.txt","r") as f:
for line in f:
if word in line:
occurrence.append(line_no)
line_no+=1
if occurrence:
print(f"the word {word} was found at lines:, {occurrence}")
else:
print(f"the word {word} was not found in the file")
check_for_word("Python")
36:59
with open("kt.txt","r") as k:
data = k.read()
if "learning" in data:
print("found")
else:
print("not found")
key topics with timestamp :------>
00:01 Today we will cover Chapter Seven about file operations.
02:07 RAM is volatile memory and not suitable for permanent storage
06:02 Using physical files in day-to-day operations
08:25 Opening a file in read mode returns a text IO wrapper
13:18 Understanding file reading modes
15:23 Reading a file and printing its contents
19:13 Appending data to a file in A mode
21:17 Differences between different modes
25:09 Different file modes in Python: Read Plus, Write Plus, Append Plus
27:19 Using the 'with' syntax in Python automatically closes the file
31:48 We can delete any file by using the remove function in the os module.
34:24 Replace Java with Python in a file using the replace method.
38:59 Write a function to find the line number of the word 'learning' in a file.
41:02 The code checks if a word exists within a given data string and prints the line number if it does.
45:28 Extract individual numbers from a string and convert them to integers
47:20 The code splits a string of numbers separated by commas and prints them individually.
thankyou
Ma'am please cover projects in this python series as you did in JS series please ❤❤❤
Ha
...
Ek projects ke sath me use kishe karna hai ye bhi Sikh lenge
To ek projects to karna padega
code for the problem to find learning in line with line index of a file
'with open('practice.txt', 'r') as file:
n = 0
for line in file:
n += 1
if 'learning' in line.strip():
print('learning found in line', n)
else:
continue'
I am from Pakistan and i am learning frontend development by watching your tutorial. you are doing absolutely great work. html css js ho gae ab react.js ka course kab aey ga
congrats
Ak sawal ha ap sa d chowk per goli kyooo cahlai
I LIKE your confidence mam/didi.
You are doing too good.
32:57 Practice Question 1 --------->
with open("practice.txt", "w") as f:
f.writelines("Hi everyone,
We are learning File I/O
using Java.
I like programming in Java.")
Construct a program which accepts a sequence of words separated by whitespace as file input. Print the words composed of digits only.
@shradhaKD mam please
Hi mam kitna aachha pdhati hai aap thank you so much
Thankyou ma'am for the lecture !
We will be really grateful if you teach us DSA USING PYTHON !
🙏
Didi one video of python modules and libraries ke liye bi bana do please
Thank you so much didi. ❤
awesome lecture didi 🙌
Please made playlist of advance java concepts
it will be great for students if you start DSA with Python...
Ma'am, The vs code is showing empty lines in output even when using the read() function for the first time. what's the reason for this?
bro save your previous txt file, then it will show output.
দিদি C++ এর একটা সিরিজ বানান।
আপনার সমস্ত ভিডিও গুলি খুবই সাহায্যকারী হয়। 😊😊😊
I am the 1st viewer of this video
Thank you so much for the awesome videos your knowledge definitely help to clear the problems 😊😊
Thank you so much didi for your efforts 👍.
Literally enjoy studying coding via you & inspired by ur efforts 😊.
Loving your content mam, I've been learning from you for so long and you make it very easy to grab a good hold on the concept, please if possible, extend this series by adding data analysis videos using numpy pandas, I'm a data enthusiast and building a career in data field. It'll be really helpful if you can add these concepts as well, and as you said you also wish to give a tutorial on machine learning, I will definitely wait for your ML videos.
write a program to convert the sequence of number into type of integer
-----------
with open('read_num.txt', 'r') as f:
read_file = f.readline()
split_stream = read_file.split(",")
int_converted_val = []
for num in split_stream:
number = int(num)
int_converted_val.append(number)
print(int_converted_val)
Kab se wait kr rha tha chapter 7 ka
when i run the program the terminal shows blank space , not the contain of the data of the file.
can any one help???
Thank you ❤❤❤ di
This series is one of the best series for learning python, easy learning with didi but apne Gangadhar ko Vidyadhar bna Diya lol :)
😄
madam in practicle question 1 instead of using
can we use multiline string quotes(tripple quotes ) as it is provinding the same output
If we go with the traditional method, what if the last no after comma is even no. In that case last no will not come in num bcoz there is no comma after that & we can't check even for it
Ps: last ques of the video
Shradha mam please make a one shot on REACT JS.
48:38
why didn't 101 print in the terminal and how to get it??
Sis make more video such as numpy full course, ai, ml, deep learning❤❤
Shaktiman is gangadhar not vidhyadhar ma'am😂 @28:20
Didi Exception handling in python !! par bhi video banayiye please 🙏❤❤❤❤
We love your classes,
Please make video lecture on pygame development 😢
Its our request
Vote for lectures on pygame
👇
WAP to find the word which we find the I/O streamed file
-------------------
def fun():
with open('read_file.txt',"r") as f:
word = 'dogs'
data = True
line = 1
while data:
data = f.readline()
if(word in data):
print(line)
return
line += 1
fun()
where can we find the notes of apna college? Shall it be only be available to those who have paid or what?
some pls help me when i write replace at 36:20 it is showing
new_data = data.replace("Java", "Python")
^^^^^^^^^^^^
AttributeError: 'builtin_function_or_method' object has no attribute 'replace'
pls help me
I'm waiting = 8th video 🧑💻🧑💻
I'm waiting = 8th video🧑💻🧑💻
^
SyntaxError: unterminated string literal (detected at line 1)
@@BizAutomate😂
😂@@BizAutomate
Practice question- 32:55
Mam please one shot on react js
Thank you for this lecture ❤ I very happy to learning at 9th 😊😊🎉
I didn't understand 38:00 where she writes "!= -1". Can someone explain.
same, whats that -1
why did you write -1 . could you please explain.
Oops concepts Tak hee hai aage bhi karaoge kya python ?
def check_for_line (n):
line_no = 1
with open("practice.txt", "r") as f:
for line in f:
if line.find (n) != -1:
print (line_no)
return
line_no += 1
return ("not found")
print(check_for_line("hi"))
Ma’am, plz make a playlist for NLP!
No credible information for NLP and computational linguistics.
M i the only 1 whoes first code is not working.
I made a file naming demo.txt
Then write
f=open ("demo.txt")
data=f.read ()
Print(data)
Print(type(data))
But in terminal it prints only type which is str but no data
I am facing same issues, Have you solved this problem, please tell me how to fix it?
I am also facing same type issue. Have you findout any solution?@@Yug-s7h
I have not a laptop and PC but still learning
How ????
Ma'am if I run the "write command in VScode " it is not working. What should I do?
Pls help... when I run the write command the text in the txt file is not overwriting as you said.... the text remains the same. Pls help..... 🙏🏽🙏🏽
why you don 't made video on exceptional handling, NumPy and the other topic
What is file text bold,underlines
please upload all lectures of python , your way of teaching is amazing , i request you to upload all lectures
its very help lectures
DiDi 🙋 Ek Simple Si Request Hai
Aap VS Code Windows Par Lecture Diya Karo.
MacOS Me Thik Nhi Lagta.
This is another type confusion with MacOS.
Had a little difficulty in understanding recursion previous lecture any tips?
do sirshasan yoga , you will understand, recursion is like a sirshasana.
same man i also face difficulty learning it still i don't undestand it any tips
kya shaktiman hi vidhyadhar hai? or vidhyadhar hi shaktiman hai to gangadhar kaun hai?(28:20)
focus on programing
def search():
with open('practice.txt','r') as f:
line1=f.readline()
line2=f.readline()
line3=f.readline()
line4=f.readline()
if 'learning' in line1 or line2 or line3 or line4:
print('found')
else:
print('1')
search()
tumne yeto print nhi kerwaya ke kis line mai found hoa ?
Thanks you shhh❤ radha ❤
Please, make one video on decorators
Q1) is there a solution to avoid print one blank line after reading any one line at a time due to impact of implicit '
' at the end of the string in line1?
mam please upload advance python course . we need it because in college our teacher dont complete the python course
Read ho rhya he jese hi write vale part me jati hu to errno 9 bad file descriptor show ho rha he... Esa kyu ho rha he???
my statement automatically showed up on next line, without mentioning "
", reason?? (19:55)
can you also pls make something like this for specific libraries like numpy and datetime
Thank you Mam.❤
Mam i have a little question.
after this session can you start django session?😥
MAM 28:21 *Gangadhar
can you do some python project and upload it in a playlist .So it will be very helpful for us
10:26 f = open("demo.txt","r")
^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'demo.txt'
plz help me
mam , while replacing the word java to python , and after that the file should be overwritten, but when i was writing the code the file is not being overwritten but the new file is being created , which should not happen right?how should i come over this error.
@ShradhaKhapra can you teach us regular expression in python GUI Thread Date and time database management using python
00:01 Today we will cover Chapter Seven about file operations.
02:07 RAM is volatile memory and not suitable for permanent storage
06:02 Using physical files in day-to-day operations
08:25 Opening a file in read mode returns a text IO wrapper
13:18 Understanding file reading modes
15:23 Reading a file and printing its contents
19:13 Appending data to a file in A mode
21:17 Differences between different modes
25:09 Different file modes in Python: Read Plus, Write Plus, Append Plus
27:19 Using the 'with' syntax in Python automatically closes the file
31:48 We can delete any file by using the remove function in the os module.
34:24 Replace Java with Python in a file using the replace method.
38:59 Write a function to find the line number of the word 'learning' in a file.
41:02 The code checks if a word exists within a given data string and prints the line number if it does.
45:28 Extract individual numbers from a string and convert them to integers
47:20 The code splits a string of numbers separated by commas and prints them individually.
kuch jyada hi free baitha h bhai tu😂😂😂
what about binary file manipulation?
please make a video on hack a wifi passworh or crash a password
🤓🤓🤓🤓
i completed 9 vedios in one day so interesting teachinng please teach also flask and Django in depth