Jump to content

what does this python code do - and why do we have a list in a list here


dil_bert

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.