Facebook – https://www.facebook.com/TheNewBoston-464114846956315/
GitHub – https://github.com/buckyroberts
Google+ – https://plus.google.com/+BuckyRoberts
LinkedIn – https://www.linkedin.com/in/buckyroberts
reddit – https://www.reddit.com/r/thenewboston/
Support – https://www.patreon.com/thenewboston
thenewboston – https://thenewboston.com/
Twitter – https://twitter.com/bucky_roberts
Amazon Auto Links: No products found.
for x in range (15,65):
girlsage = x / 2 + 7
print (“you are {} years old and you can date a {} year old”.format(x,girlsage))
def allowed_age(my_age):
girls_age = my_age / 2 + 7
return girls_age
for person in range(25,61):
range = allowed_age(person)
print(person, “age, has a date limit of”, range)
Bucky at his best!! If all tutorials would have been like this many more people would have learned programming…
def ppl_age(my_age):
girl_age = my_age/2 + 7
return girl_age
for n in range(15,60):
ages = ppl_age(n)
print(ages)
def allowed_dating_age(age):
opposite_sex_age = age/2 + 7
return opposite_sex_age
johns_age = 15
johns_limit = allowed_dating_age(15)
print(“Johns age is”, johns_age, “and his allowed dating age is”, johns_limit,”or older”)
def allowed_age(age):
girls_age = age / 2 + 7
print (“You’re allowed to date girls from”, girls_age, “years old”)
for a in range(15,61):
allowed_age(a)
def allowed_dating_age(age):
girls_age=age/2+7
return girls_age
for x in range(15,61):
limit = allowed_dating_age(x)
print(‘The person of age’,x,’can date girls of age’,limit,’or more’)
Thanks bucky (Y)
HW:
def allowed_dating_age(my_age):
girls_age = my_age/2 +7
return girls_age
for n in range (16,61):
andres_limit = allowed_dating_age(n)
print(“Andre is”,n,”, he can date girls”,andres_limit, “or older”)
idiot
Thank you so much, I’m really into your tutorials.
def date_age_lim(my_age):
age_limit = (my_age // 2) + 8
return age_limit
for x in range(15, 50):
limited_age = date_age_lim(x)
print(‘you are’, x, ‘your partner’s limited age is’,limited_age)
For girls dating age limit can be calculated by
Men_age= Girl_age*2 -7
def my_age_limit(my_age):
girls_age=my_age/2+7
return girls_age
for my_age in range (15,61):
my_limit=my_age_limit(my_age)
print(“My age is”,my_age,”and my limit is”, my_limit)
I’m super happy!!!
New to coding I completed the “Homework” and after attempting to run it for the first time I didn’t get a single error!!
Please review my code. I know I should have turned the multiple print statements into a for loop but I was too happy when I solved this problem in mear mins.
I also typecast the result… well because 24.5 makes no sense. who dates a girl 24.5 years old?? WHO?!?
list_of_ages = [35,40,45,50,55,60]
def age_limit (list_of_ages):
girls_age = list_of_ages / 2 + 7
return girls_age
guy0 = age_limit(list_of_ages [0])
guy1 = age_limit(list_of_ages [1])
guy2 = age_limit(list_of_ages [2])
guy3 = age_limit(list_of_ages [3])
guy4 = age_limit(list_of_ages [4])
guy5 = age_limit(list_of_ages [5])
print(“Guy number one age: “,list_of_ages[0], ” can date a girl as young as:”, int(guy0), “or older”)
print(“Guy number Two age: “,list_of_ages[1], ” can date a girl as young as:”, int(guy1), “or older”)
print(“Guy number three age: “,list_of_ages[2], ” can date a girl as young as:”, int(guy2), “or older”)
print(“Guy number four age: “,list_of_ages[3], ” can date a girl as young as:”, int(guy3), “or older”)
print(“Guy number five age: “,list_of_ages[4], ” can date a girl as young as:”, int(guy4), “or older”)
print(“Guy number six age: “, list_of_ages[5], ” can date a girl as young as:”,int(guy5), “or older”)
OUTPUT::
Guy number one age: 35 can date a girl as young as: 24 or older
Guy number Two age: 40 can date a girl as young as: 27 or older
Guy number three age: 45 can date a girl as young as: 29 or older
Guy number four age: 50 can date a girl as young as: 32 or older
Guy number five age: 55 can date a girl as young as: 34 or older
Guy number six age: 60 can date a girl as young as: 37 or older
wat if ur 14 and ur gf is 14 but 1 month younger
def allowed_dating_age(age):
girls_age = age/2 + 7
return girls_age
for x in range(15,61):
agelimit = allowed_dating_age(x)
print(‘If you are ‘,x,’ you are allowed to date a’,agelimit,’year old female’)
def allowed_age(my_age):
her_age=my_age/2+8 #Add eight years because 7 is pushing it
return her_age
for x in range (15, 61):
man_limit = allowed_age(x)
print(x, “year old men can date”, man_limit, “old women.”)
Best Code:
for GuysAge in range(15,61):
def Eligible_Girl(GuysAge):
GirlsAge = GuysAge/2 + 7
return GirlsAge
print(“Guy of age “, GuysAge, ” Can date a girl who’s age is”, Eligible_Girl(GuysAge))
I’m 14… and I got 14…
def whichage(age):
girlage = age/2 +7
return girlage
for i in range(15,66):
girlage2 = whichage(i)
print(“the minimum girl age for a man whose age is “,i,” is :”,girlage2)
Give this man some beef, he deserves it.
list = []
def func1(m, n): #the idea is you can set the range yourself by choosing what values m(minimum) and n(maximum) are
for o in range(m, n):
list.append(o) #func1 creates a list with all the ages in the set range
def func2(): #this is a just a table that is neatly formatted(on my PyCharm at least)
print(“Age:”, “tMinimum:”)
for n in list:
limit = n/2 + 7
age = n
print(age, “t”* 2, limit)
func1(14, 45) #just calling the functions and set m and n in the first function
func2()
print(list) #did this to see if things were working as intended
Sorry for complexity
Homework:
def yo_matrimony (age):
marriageAge= age/2+7
return marriageAge
print(“Your Age” +” “+”Girl Age”)
for x in range (15,60):
print ( x, ” ” ,yo_matrimony(x) )
My code:
def age_allowed_todate (your_age):
girls_age = your_age / 2 +7
return girls_age
for i in range(15,61):
my_limit = age_allowed_todate(i)
print(i, my_limit)
does this gives the intended result?
I think the logic is a bit off.
What would you recommend me do in order for it to yield the correct result?
def date(age,page):
for i in range(15,61):
bage = (age)/2 +7
if (bage >= page):
print(“Anna can date boys up to”,bage,”or older”)
print(“The are compatible”,page,”and”,bage)
print(page,bage)
else:
print(“No way hosay,”,page,”and”,bage)
print(page,bage)
break
def allowed_dating_age(my_age):
girls_age=(my_age/2)+7
return girls_age
for i in range(15,61):
x=allowed_dating_age(i)
print(i,x)
My code:
def speedlimiter(speed):
if speed <=25: return "You are good" else: return "You are fucked" BMW = speedlimiter(45) print("Hello", BMW) Mercedes = speedlimiter(15) print("Hello", Mercedes)
I’m 12 my limit is 13 !
that just wrong man
she is too young for me !
This will give the age details for people between 16 – 70
def func1(myage):
allowed_girls_age = (int(myage)/2 + 7)
print(“People on age ” + str(myage) + ” : ” + “can date with older than : ” + str(allowed_girls_age))
return (allowed_girls_age)
# Just allowed the person’s age criteria as more than 15 years
for age in range(15,70):
if int(age) > 15:
func1(age)
that not used paranteses and semicolons for better and easier looking but i think with them were the languages better like C or Java. I know both of them and think that with paranteses and semicoloms the language looks more organized
def dating_age_limit():
for f in range(15, 61):
print(“Dude’s age:”, f, “can date girls”, f/2 + 7, “or older”)
dating_age_limit()
Hi Bucky, I ran the following code but the result is not what I expected (the result is 0, which it shouldn’t be). Could you kindly help?
def how_much_shares_to_buy(current_price):
portion=(current_price-16)/(30-16)
return portion
total_allocation=500000*how_much_shares_to_buy(20)
print(total_allocation)
the limit of a 12 year old boy would be 13 lol
soln:
def allowed_dating_age (age) :
girls_age= age/2 +7
return girls_age
for age in range (15, 60):
limitofpeople= allowed_dating_age (age)
print(age, limitofpeople)
def allowed_dating_age(persons_age):
girls_age = persons_age/2 + 10
return girls_age
for i in range(15, 60):
age_limit = allowed_dating_age(i)
print(i, age_limit)
name = [“Bayo”, “Usman”, “Charles”, “Kelechi”, “Ibibabo”]
age = [27, 36, 19, 23, 41]
def allowed_dating_age(boy_age):
girl_age = boy_age/2 + 7
return(girl_age)
for n in range(5):
print(name[n], ” is”, age[n], “years old and can date girls of “, allowed_dating_age(age[n]), “years of age and above”)
Output:
Bayo is 27 years old and can date girls of 20.5 years of age and above
Usman is 36 years old and can date girls of 25.0 years of age and above
Charles is 19 years old and can date girls of 16.5 years of age and above
Kelechi is 23 years old and can date girls of 18.5 years of age and above
Ibibabo is 41 years old and can date girls of 27.5 years of age and above
def allowed_dating_age(age):
girls_age = age/2+7
return girls_age
for age in range(15,61):
limit = allowed_dating_age(age)
print(‘If you are’,age,’years old’,’-‘,int(limit),’is the youngest you can date’)
I am 15 nd my limit is apparently 14.5 thats actually a pretty awesome alg bucky
with ‘return’ it does print the value for me. Is this actually normal?
Code for Challenge at the end of video
def dateage(my_age):
x = 15
girlage = my_age / 2 + 7
return girlage
for x in range(14, 50):
limit = dateage(x)
x += 1
print(x, limit)
Output:
15 14.0
16 14.5
17 15.0
18 15.5
19 16.0
20 16.5
21 17.0
22 17.5
23 18.0
24 18.5
25 19.0
26 19.5
27 20.0
28 20.5
29 21.0
30 21.5
31 22.0
32 22.5
33 23.0
34 23.5
35 24.0
36 24.5
37 25.0
38 25.5
39 26.0
40 26.5
41 27.0
42 27.5
43 28.0
44 28.5
45 29.0
46 29.5
47 30.0
48 30.5
49 31.0
50 31.5
It was fairly easy:
def x():
print(‘Your age: Age dating limit:’)
for myAge in range(15,61):
gAge = myAge / 2 + 7
print(myAge, ‘ ‘, gAge)
x()
def age_limit():
for n in range(15, 60):
print(n/2 + 7)
age_limit()
Your personality and way of explaining information make these tutorials very useful, great job!
”’
——————Calculate how many hookers ——————-
Each Pimp has 3 hoes, there is only 5 pimps
Count the total of all the hoes
”’
# define function that has parameter hookers amount
def hoes(hookers_amount):
hookers_count = hookers_amount * 5
return hookers_count
pimp_hoes = hoes(3)
print(“There is a total of”, pimp_hoes, “hoes shared between the pimps”)
(‘Bucky’s awesome!!!’) 🙂
def allowed_dating_age(age):
girls_age = age / 2 +7
return girls_age
for n in range(61):
if n < 15: continue elif n < 61: print(allowed_dating_age(n)) continue else: break