Computer Science, asked by somil21, 6 months ago

WAP TO INPUT THE NAME AND AGE OF A PERSON AS A PARAMETER AND DISPLAY WHETHER HE IS ELIGIBLE TO VOTE OR NOT.​

Answers

Answered by valeriy69
4

\large\mathsf\color{pink}{Solution\: using\: python\: 3}

def can_vote(name, age):

if int(age) >= 18:

return f"{name} can vote!"

return f"{name} can't vote!"

name, age = [x for x in input("enter name & age: ").split()]

print(can_vote(name, age))

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Answered by Japji21
0

Explanation:

def can_vote(name, age):

if int(age) >= 18:

return f"{name} can vote!"

return f"{name} can't vote!"

name, age = [x for x in input("enter name & age: ").split()]

print(can_vote(name, age))

Similar questions