[[email protected] test1]# vim 4.py //ADD #!/usr/bin/python info = {} name = raw_input("Please input a name: ") age = raw_input("Please input your age: ") gender = raw_input("Please input (M/F): ") info[‘name‘] = name info[‘age‘] = age info[‘gender‘] = gender for k, v in info.items(): print "%s: %s" % (k, v) print ‘main end‘ [[email protected] test1]# python 4.py Please input a name: Mike Please input your age: 30 Please input (M/F): M gender: M age: 30 name: Mike main end
时间: 2024-10-08 03:04:21