Skip to content

Commit b885600

Browse files
committed
file
1 parent 4a4f1fc commit b885600

File tree

4 files changed

+111
-0
lines changed

4 files changed

+111
-0
lines changed

FileHandling/SalesDataAI (1).txt

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
Date Region Rep ID Product Qty Unit Price
2+
17-Jun-19 North E011 Product D 22 5
3+
23-Jun-19 North E011 Product D 24 5
4+
26-Jun-19 North E011 Product C 9 8
5+
29-Jun-19 North E011 Product C 6 8
6+
2-Jul-19 North E011 Product D 7 5
7+
4-Jul-19 North E011 Product D 15 5
8+
8-Jul-19 North E011 Product B 19 15
9+
20-Jul-19 North E011 Product A 23 10
10+
22-Jul-19 North E011 Product A 10 10
11+
23-Jul-19 North E011 Product A 13 10
12+
1-Aug-19 North E011 Product B 22 15
13+
7-Aug-19 North E011 Product B 12 15
14+
9-Aug-19 North E011 Product C 10 8
15+
15-Aug-19 North E011 Product B 18 15
16+
21-Aug-19 North E011 Product C 13 8
17+
22-Aug-19 North E011 Product A 20 10
18+
27-Aug-19 North E011 Product B 17 15
19+
1-Jun-19 South E012 Product A 23 10
20+
5-Jun-19 South E012 Product B 19 15
21+
8-Jun-19 South E012 Product C 23 8
22+
16-Jun-19 South E012 Product B 24 15
23+
19-Jun-19 South E012 Product C 17 8
24+
25-Jun-19 South E012 Product A 17 10
25+
28-Jun-19 South E012 Product B 7 15
26+
13-Jul-19 South E012 Product B 13 15
27+
26-Jul-19 South E012 Product C 7 8
28+
28-Jul-19 South E012 Product A 21 10
29+
12-Aug-19 South E012 Product A 14 10
30+
19-Aug-19 South E012 Product D 12 5
31+
28-Aug-19 South E012 Product A 7 10
32+
2-Jun-19 East E013 Product C 20 8
33+
4-Jun-19 East E013 Product B 8 15
34+
10-Jun-19 East E013 Product C 20 8
35+
11-Jun-19 East E013 Product D 18 5
36+
20-Jun-19 East E013 Product B 23 15
37+
1-Jul-19 East E013 Product C 15 8
38+
5-Jul-19 East E013 Product D 22 5
39+
7-Jul-19 East E013 Product C 21 8
40+
16-Jul-19 East E013 Product B 7 15
41+
17-Jul-19 East E013 Product B 19 15
42+
31-Jul-19 East E013 Product B 24 15
43+
10-Aug-19 East E013 Product B 15 15
44+
13-Aug-19 East E013 Product C 15 8
45+
16-Aug-19 East E013 Product C 8 8
46+
24-Aug-19 East E013 Product A 11 10
47+
7-Jun-19 West E014 Product B 23 15
48+
13-Jun-19 West E014 Product C 24 8
49+
14-Jun-19 West E014 Product A 22 10
50+
22-Jun-19 West E014 Product B 18 15
51+
10-Jul-19 West E014 Product A 19 10
52+
11-Jul-19 West E014 Product D 15 5
53+
14-Jul-19 West E014 Product D 8 5
54+
19-Jul-19 West E014 Product D 6 5
55+
25-Jul-19 West E014 Product A 9 10
56+
29-Jul-19 West E014 Product A 18 10
57+
3-Aug-19 West E014 Product C 25 8
58+
4-Aug-19 West E014 Product D 11 5
59+
6-Aug-19 West E014 Product B 10 15
60+
18-Aug-19 West E014 Product A 7 10
61+
25-Aug-19 West E014 Product D 12 5

FileHandling/fileHandling.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# File Handling :
2+
3+
f = open('SalesDataAi (1).txt')
4+
print(f.readline())
5+
6+
7+
8+
9+
# with open('SalesDataAi (1).txt','r') as file:
10+
# first_line = file.readline().strip()
11+
12+
# parts = first_line.split('\t')
13+
# print(parts)
14+
15+
with open("SalesDataAi (1).txt", "r") as file:
16+
for line in file:
17+
parts = line.strip().split("\t") # split with tab
18+
print(parts)
19+
20+
21+
22+
total_unit_price = 0
23+
24+
with open("SalesDataAI (1).txt", "r") as file:
25+
next(file) # Skip header line
26+
for line in file:
27+
parts = line.strip().split("\t") # Split by tab
28+
unit_price = int(parts[-1]) # Last column is Unit Price
29+
total_unit_price += unit_price
30+
31+
print("Total Unit Price:", total_unit_price)

IterationTool/iterationtools.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# https://app.eraser.io/workspace/sUKzflOFI1LhGZpE3kj4?origin=share
2+
3+
# Iteration tool
4+
5+
f = open('read.py')
6+
# print(f.readline())
7+
# print(f.readline())
8+
# print(f.readline())
9+
10+
# f.__next__()
11+
12+
print(f.readlines(),)
13+
14+
15+
for line in open('read.py'):
16+
print(line)

IterationTool/read.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import time
2+
username = 'maaz'
3+
print(username)

0 commit comments

Comments
 (0)