Code Screenshot :

Executable
Code:
#Prompting the user for bday inputs
birth_year = int(input("Please enter year of birth: "))
birth_month = int(input("Please enter month of birth: "))
birth_day = int(input("Please enter day of birth: "))
#Prompting the user fo current day inputs
current_year = int(input("\nPlease enter Current year: "))
current_month = int(input("Please enter Current month: "))
current_day = int(input("Please enter Current day: "))
#Checking if the user can vote
if (current_year - birth_year)==18:
if (current_month == birth_month):
if(current_day>=birth_day):
print("\nCongrats, you can vote")
else: print("\nSorry you cannot
vote")
elif(current_month>birth_month):
print("\nCongrats, you can
vote")
else: print("\nSorry you cannot vote")
elif (current_year - birth_year)>18:
print("\nCongrats, you can vote")
else:
print("\nSorry you cannot vote")
Sample
Output:


Please comment
below if you have any queries.
Please do give a thumbs up if you liked the answer thanks
:)
1. Write a Python program that will determine if the user can vote or not. The...
Using Python, write a program that prompts the user to enter their age as an integer and then prints out a message that says I suspect you were born in the year xxxx where "xxxx" is the current year minus the age entered. An example run where the user entered 10 for their age, would look like this: Please enter your age as an integer: 10 I suspect you were born in 2009
write a program that asks the user to enter two integers one at a time if the first value is not an integer then do not ask for a second then display both values otherwise print error message stating which value entered was not an integer python
Write a program that prompts the user to enter a person's birth date in numeric form (e.g. 8-27-1980) and outputs the date of birth in the format of month day, year (e.g. August 27, 1980). Your program must work for three types of exceptions - invalid day, invalid month and invalid year (year must be between 1915 and 2015). Make these as class driven exceptions. Use one try-catch block with separate catches for the exception classes to handle errors for...
in python Write a program that reads the date of birth from the user as 3 integer values (day, month, year) and then computes and prints their exact age in days. You need to take into account the leap You may not use any built-in functions related to date and time! Example: Someone born on 01/01/2000 is 365 days * 18 years + 5 days (since the years 2000, 2004, 2008, 2012, and 2016 are all leap years) + 352...
Write a program(Python language for the following three questions), with comments, to do the following: Ask the user to enter an alphabetic string and assign the input to a variable str1. Print str1. Check if str1 is valid, i.e. consists of only alphabetic characters. If str1 is valid Print “<str1> is a valid string.” If the first character of str1 is uppercase, print the entire string in uppercase, with a suitable message. If the first character of str1 is...
Q1: Write a Java program that will display different messages depending on your age. Your program should ask the user for his/her name and their age in years and give one or more answers from the following ones below: if the age of the user is less than 16, the program should print on the screen “You are not allowed to drive at the moment”. if the age of the user is less than 18, the program should print on...
Task 1 Write a Python program that reads in any number of birth years until the number zero is entered. The program will then print out the average age and how old the youngest and oldest, respectively. For this task, you can start from the pseudo-code (separately) you received to get started. Example of program execution (user entries in numbers (year)): Enter year of birth. To finish, enter the number 0. Year: 1998 Year: 1932 Year: 1887 Error: Unreasonable year....
Write a C program which creates a template for a structure to store somebody's date of birth (day, month, and year). Then write a C function that takes two such structure, one which represents the date of birth, and the other today's date, and returns the age of the user in years. Your function can either provide the full year only (integer) or the floating point age (bonus marks). Next, write a C program which asks the user to enter...
1) Write a Python program that prompts the user to enter the current month name and prints the season for that month. Hint: If the user enters March, the output should be "Spring"; if the user enters June, the output should be "Summer". 2 )Write a Python program using the recursive/loop structure to print out an equilateral triangle below (double spacing and one space between any two adjacent asterisks in the same row). * * * * *...
Write a program in visual c# program named CheckMonth that prompts a user to enter a birth month. If the value entered is greater than 12 or less than 1, display an error message; otherwise, display the valid month with a message such as 3 is a valid month.