给出N个名称和年龄python的输入,创建一个向量

时间:2016-09-29 05:02:14

标签: python dictionary vector

我需要创建一个程序,将多个名称和年龄的条目作为输入。然后我希望它返回那些年龄值高于所有条目平均年龄的条目的名称和年龄。 例如:

input( "Enter a name: ") Albert   
input( "Enter an age: ") 16

input( "Enter a name: ") Robert   
input( "Enter an age: ") 18

input( "Enter a name: ") Rose  
input( "Enter an age: ") 20

The average is = 18
Rose at 20 is higher than the average. 

我该怎么做?

1 个答案:

答案 0 :(得分:1)

<IfModule mod_expires.c>
ExpiresActive on

# Your document html
ExpiresByType text/html "access plus 0 seconds"

# Media: images, video, audio
ExpiresByType audio/ogg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType video/ogg "access plus 1 month"
ExpiresByType video/webm "access plus 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>

这个答案基于“Python Crash Course:A Hands-On,Project-Based Introduction to Programming”一书中的类似例子https://www.nostarch.com/pythoncrashcourse