Skip to content

Commit aa25039

Browse files
committed
extensions
1 parent 999fb64 commit aa25039

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
ext = input("File name: ").lower().strip()
2+
3+
if "png" in ext:
4+
print("image/png")
5+
elif "jpg" in ext:
6+
print("image/jpeg")
7+
elif "jpeg" in ext:
8+
print("image/jpeg")
9+
elif "gif" in ext:
10+
print("image/gif")
11+
12+
elif "pdf" in ext:
13+
print("application/pdf")
14+
15+
elif "txt" in ext:
16+
print("text/plain")
17+
18+
elif "zip" in ext:
19+
print("application/zip")
20+
21+
else:
22+
print("application/octet-stream")
23+

0 commit comments

Comments
 (0)