sometimes you need help from great master toriel.
knock knock
Who is there?
Old lady!
Old lady who?
Oh! i didn't know you could yodel!
sometimes you need help from great master toriel.
knock knock
Who is there?
Old lady!
Old lady who?
Oh! i didn't know you could yodel!
DROP ON UR KNEES AND BARK LIKE U WANT IT (lol)
Like RIGHHT??? I hate how they call bacon guy ugly while they get those stupid ahh faces w/ scars and hair that looks like dried kelpt
@danniltrifonov we do that
Hope it worked :)
is_minor()You wrote:
if age > 18:
is_minor = True
else:
is_minor = False
This means someone over 18 is considered a minor, which is backwards.
It should be:
if age < 18:
is_minor = True
else:
is_minor = False
Or even shorter:
return age < 18
file.write()In write_to_file():
file.write(name + ", "
You forgot the closing ) for that file.write call.
file.write() needs a string.
You’re trying to write:
file.write(minor)
But minor is a boolean (True or False). You must convert it to string:
file.write(str(minor))
r+r+ means read/write without truncating. If the file doesn’t exist, it will throw an error. If you just want to append, use "a" or "a+". If you want to overwrite, use "w".
Here’s a working version:
# Open in append mode
file = open("database.txt", "a")
name = input("Enter your name: ")
age = int(input("Enter your age: "))
def is_minor(age):
return age < 18
minor = is_minor(age)
def write_to_file(name, age, file, minor):
file.write(name + ", ")
file.write(str(age) + ", ")
file.write(str(minor) + "\n")
write_to_file(name, age, file, minor)
file.close()
Tbr I really like punk rock but idk about y'all. (example: Basket case by Green Day)