dil_bert Posted January 12, 2018 Share Posted January 12, 2018 hello dear experts what does this python code do - and why do we have a list in a list here def main (): friends [] for i in range(2) print ("contact manager") name = input("input name") phone = input("input phone") name = input("input email") friends.append ([name, phone, email]) for in in range(len(friends)): print ("contact info") for j in rang(len(friends[1])): print(friends[i][j]) if __name__ == *__main__*: main() Link to comment Share on other sites More sharing options...
requinix Posted January 13, 2018 Share Posted January 13, 2018 Python is a very readable language. Take a guess at what it's doing. Link to comment Share on other sites More sharing options...
dil_bert Posted January 13, 2018 Author Share Posted January 13, 2018 hello dear requinix it is true - python is very readable Python is a very readable language. Take a guess at what it's doing. in short: this code waits for an entry - of contact-info and takes then the gathered data and prints it out. the first list takes care for gathering the infos - from "user-entry" the second list ( let me say it wraps all the things) prints out the gathered infos this is only a very very short form of what i read out of the code... note: i have to use a better IDE or Editor... To use such is pretty important in Python -. because oft he indentation... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.