Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Contact Class 2.0
''' Created on 01.11.2018 @author: Byron.Chen ''' class Contact: def __init__(self): self.__Email = [] self.__Phone = [] self.__SocialMedia = [] print ("Contact Initialized...") def AddEmail(self, e): self.__Email.append(e) print (e + " saved!") def DeleteEmail(self): print("Which one you want to delete?") for i in range(len(self.__Email)): print (self.__Email[i]) e = input("Your choice: ") self.__Email.remove(e) print (e + " deleted!") def GetEmail(self): for i in range(len(self.__Email)): return self.__Email[i] def AddPhone(self, p): self.__Phone.append(p) print (p + " saved!") def DeletePhone(self): print("Which one you want to delete?") for i in range(len(self.__Phone)): print (self.__Phone[i]) p = input("Your choice: ") self.__Phone.remove(p) print (p + " deleted!") def GetPhone(self): for i in range(len(self.__Phone)): return self.__Phone[i] def AddSocialMedia(self, SM): self.__SocialMedia.append(SM) print (SM + " saved!") def DeleteSocialMedia(self): print("Which one you want to delete?") for i in range(len(self.__SocialMedia)): print (self.__SocialMedia[i]) SM = input("Your choice: ") self.__SocialMedia.remove(SM) print (SM + " deleted!") def GetSocialMedia(self): for i in range(len(self.__SocialMedia)): return self.__SocialMedia[i] myContact = Contact() myContact.AddEmail("aaa@qq.com") myContact.AddEmail("abc@qq.com") myContact.AddPhone("17715396171") myContact.AddPhone("18626117788") myContact.AddPhone("11223112234") myContact.AddSocialMedia("674755822@qq") myContact.AddSocialMedia("17713321@wechat") myContact.DeleteEmail() print(myContact.GetEmail())
run
|
edit
|
history
|
help
0
L4-HW final
Lesson6 part b
Python Unit Test Case Sample
количество 1 и 0 в последовательности чисел до n
Q3
last 2 digit add
spoj ANARC09A
Game4
gfg pattern
f strings 3