1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
inessss [21]
2 years ago
10

Repeat the exercise in the task 3 (version 2), where in addition you need to ask the user for their citizenship and if they are

currently in prison convicted for a criminal offence. Your program should print a nice message telling the user if they are eligible to vote (i.e. if they are 18+, Canadian and do not live in prison convicted for a criminal offence, then they can vote. Otherwise not). You should modify function is_eligible so it takes to additional paramters as input. In particular the head of the function should be: is_eligible(age, citizenship, prison)
Computers and Technology
1 answer:
Dahasolnce [82]2 years ago
8 0

Using knowledge in phyton it is possible to write code that uses program should print a nice message telling the user if they are eligible to vote.

<h3>Writting in python:</h3>

<em>def is_eligible(age, citizenship, prison):</em>

<em>  # Converting the inputs into lower for validation</em>

<em>  citizenship = citizenship.lower()</em>

<em>  prison = prison.lower()</em>

<em />

<em>  # 18+ Canadian and do not live in prison can vote</em>

<em>  if(age >= 18 and prison == "yes" and (citizenship == "canada" or citizenship == "Canadian")):</em>

<em>    return True</em>

<em>  return False</em>

<em />

<em># Implement your I/O here</em>

<em />

<em># getting required inputs from user</em>

<em>citizenship = input("Please Enter your Citizenship: ")</em>

<em>prison = input("Please Enter if you are in prison YES/NO: ")</em>

<em>age = int(input("Please Enter your Age: "))</em>

<em />

<em>is_eligible = is_eligible(age, citizenship, prison)</em>

<em>if is_eligible:</em>

<em>  print("Congratulations, You are eligible to Vote!!")</em>

<em>else:</em>

<em>  print("Sorry, You can't Vote")</em>

See more about python at brainly.com/question/18502436

#SPJ1

You might be interested in
Antivirus software products require that you update _____ on a regular basis
german
Operating System, as far as I know @[email protected]
5 0
4 years ago
Read 2 more answers
.The __________ comes in handy when I'm using Microsoft Word to type an essay with a specific word number requirement
mihalych1998 [28]

Answer:

character count

Explanation:

The answer is probably character count.

6 0
3 years ago
What does coding mean​
NeTakaya
The process or activity of writing computer programs.
3 0
3 years ago
Read 2 more answers
Do you think that feedly will help you create an effective personal online learning environment? Why or why not?
goldenfox [79]

Yes. Feedly will help me create an effective personal online environment. I am able to keep up with all the topics that matter to me most. Feedly is able to help me discover insightful sources from publications and blogs. Feedly is also able to uniquely offer clean, minimalist reading experience optimized for productivity.

5 0
3 years ago
In two to three paragraphs, come up with a way that you could incorporate the most technologically advanced gaming into your onl
Marina CMI [18]

nobody cares about plagiarism dude

7 0
3 years ago
Other questions:
  • Consider the following method: public static void arrayMystery(int[] array) { for (int i = 0; i &lt; array.length - 1; i++) { if
    10·1 answer
  • 7.12 LAB: Contains the character
    12·2 answers
  • We never need to use a forward declaration when invoking a public subprogram. true or false?
    15·1 answer
  • Write the definition of a function named printstarbucks that receives a non-negative integer n and prints a line consisting of n
    6·1 answer
  • What are factors that limit a technological design
    11·2 answers
  • The relational database is the primary method for organizing and maintaining data today in information systems. It organizes dat
    9·1 answer
  • KAPWING Video Editing Software allows you to use existing You Tube Videos in your design.
    8·1 answer
  • Kai notices his laptop is running sluggishly, so he wants to check his system resources for any issues. Which utility can he use
    11·2 answers
  • We love silky. she is very honest join this by using conjunction ​
    11·2 answers
  • A Chain of dry-cleaning outlets wants to improve its operations by using data from devices at individual locations to make real-
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!