168k views
9 votes
Part 2: Code the Program

Use the following guidelines to code your program.
1. Use the Python IDLE to write your program.
2. Using comments, type a heading that includes your name, today’s date, and a short description.
3. Set up your def main(): statement. (Don’t forget the parentheses and colon.)
4. Write one if-else statement using user input.
5. Include a print message for both conditions (True and False).
6. Conclude the program with the main() statement.
7. Follow the Python style conventions regarding indentation in your program.
8. Run your program to ensure it is working properly. Fix any errors you may observe.

When you've completed writing your program code, save your work by selecting 'Save' in the Python IDLE

u get brianliest if u can help

User Mast
by
5.5k points

1 Answer

6 votes

Answer:

You can try something like this:

# YOUR NAME

# May 16th 2022

# This program

def main():

age = input("Enter your name: ")

if not age.isnumeric():

print('Invalid input.')

return

if (int(age) >= 18):

print('You are an adult.')

else:

print('You are a minor.')

main()

User Brown Smith
by
5.4k points