Looping through a number of ages to get the dating limit.

+1 Malay Anand · May 13, 2015
Well here's my code!

# the age limit calculator
def your_age(age):
age_limit = age/2 + 7
return age_limit

'''
this calls the function you_age, passes a value from the list_of_ages
and gives it out to the users
'''
for x in range(16, 41):
print(x)
limit = your_age(x)
print("Your dating age limit is ", limit, "or older")

Post a Reply

Replies

Oldest  Newest  Rating
+1 Colonel Panic · May 14, 2015
Is there a question here?
+1 Nihal N · May 16, 2015
Well here is my code toooo :P

def dating_age(my_age):
girlage = my_age/2 + 7
return girlage


for x in range(14 , 64):
age = dating_age(x)
print("Age :",x,"--->""you can date the girl with the age of",age,"or older.")
  • 1

Python

106,984 followers
About

This section is all about snakes! Just kidding.

Links
Moderators
Bucky Roberts Administrator