Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last Update #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 51 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,55 @@
class Solution:
pass
def IP_ADD():

Enter = input("Enter Your IP: ")
first_sp = Enter.split("/")
second_sp = first_sp[0].split(".")
print(second_sp)

# Class A Public & Private IP Address Range
if (int(second_sp[0]) >= 1 and int(second_sp[0]) <= 127):

if (int(second_sp[0]) == 10):
print("Class: A, Designation: Private")
elif (int(second_sp[0]) == 127 and int(second_sp[1]) == 0 and int(second_sp[2]) == 0 and int(second_sp[3]) > 0):
print("Class: A, Designation: Spical")
else:
print("Class: A, Designation: Public")


#Class B Public & Private IP Address Range
if (int(second_sp[0]) >= 128 and int(second_sp[0]) <= 191):

if (int(second_sp[0]) == 172 and int(second_sp[1]) >= 16 and int(second_sp[1]) <= 31):
print("Class: B, Designation: Private")

print("Class: B, Designation: Public")



#Class C Public & Private IP Address Range
if (int(second_sp[0]) >= 192 and int(second_sp[0]) <= 223):

if (int(second_sp[0]) == 192 and int(second_sp[1]) == 168):
print("Class: C, Designation: Private")

elif (int(second_sp[0]) >= 192 and int(second_sp[0]) <= 223):
print("Class: C, Designation: Public")



#Class D IP Address Range
if (int(second_sp[0]) >= 224 and int(second_sp[0]) <= 239):
print("Class: D")



#Class E IP Address Class
if (int(second_sp[0]) >= 240 and int(second_sp[0]) <= 255):
print("Class: E")



Solution.IP_ADD()
if __name__ == '__main__':
pass
pass