Skip to content

Commit 981e0a0

Browse files
author
anwar-ul-azim
committed
update
1 parent c1d30c7 commit 981e0a0

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

Course_Content/Class-1/README.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,29 +22,28 @@ by NSUCEC R&D on august 2019
2222
## Class-1 Assignment:
2323

2424
**There is txt file named “movie_information.txt” which holds the following information.**
25-
*** Movie Name**
26-
*** Director name**
27-
*** Lead Actor Name**
28-
*** Releasing Year**
29-
*** Total earning of that movie**
25+
**-> Movie Name**
26+
**-> Director name**
27+
**-> Lead Actor Name**
28+
**-> Releasing Year**
29+
**-> Total earning of that movie**
3030
**Read the file “movie_information.txt” and do the following tasks:-**
31-
**-> Display the information stored on the file**
32-
**-> First read the file line by line and split the information on the basis of “ : ” and store the Movie Name and the Lead Actor Name into two separate variable.**
33-
**-> Store the new information into another file named “Actor_Information.txt” using “Name of the Actor : Movie Name” this convention.**
31+
**-> Display the information stored on the file**
32+
**-> First read the file line by line and split the information on the basis of “ : ” and store the Movie Name and the Lead Actor Name into two separate variable.**
33+
**-> Store the new information into another file named “Actor_Information.txt” using “Name of the Actor : Movie Name” this convention.**
3434

3535
#### Solution:
36-
3736
```python
3837
with open("movie_Information.txt",'r') as f:
39-
movies = f.read()
38+
movies = f.read()
4039

41-
with open ("Actors_Information.txt",'a') as m:
42-
movies = movies.split("\n")
40+
with open ("Actors_Information.txt",'a') as m:
41+
movies = movies.split("\n")
4342

44-
for movie in movies:
45-
actor_name = (movie.split(":")[2])
46-
movie_name = (movie.split(":")[0])
47-
m.write(actor_name.strip() + " : " + movie_name.strip() + '\n')
43+
for movie in movies:
44+
actor_name = (movie.split(":")[2])
45+
movie_name = (movie.split(":")[0])
46+
m.write(actor_name.strip() + " : " + movie_name.strip() + '\n')
4847
```
4948

5049
***

0 commit comments

Comments
 (0)