Question

Important: This code must be written without the use of <and> or range. Create the Congress...

Important: This code must be written without the use of <and> or range.

Create the Congress Program as Python program: A) A person is eligible to be a US senator if they are at least 30 years old and have been a US citizen for at least 9 years. B) To be a US representative these numbers are 25 and 7, respectively. C) They are not eligible for either if...? Your program will accept a person's age and years of citizenship as inputs. Your outputs will be one of the following: You are eligible to be a Senator or a Representative. You are eligible to be a Representative. You are not eligible to run for Congress.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Hello, here is the completed code you wanted. Every important statement is explained using comments. Please check and let me know if you have any doubts. Thanks.

CODE

#main function
def main():
   #prompt for age
   age = int(input("Enter your age: "))
  
   #prompt for years of citizenship
   citizenship = int(input("Enter your years of citizenship: "))
  
   #if age is greater than or equals 30
   if age >= 30:
       #if citizenship is greater than or equals 9
       if citizenship >= 9:
           print("You are eligible to be a Senator or a Representative.")
       #if citizenship is greater than or equals 7 and less than 9
       elif citizenship >= 7:
           print("You are eligible to be a Representative.")
       #if citizenship is less than 7
       else:
           print("You are not eligible to run for Congress.")
   #if age is greater than or equals 25 and less than 30
   elif age >= 25:
       #if citizenship is greater than or equals 7
       if citizenship >= 7:
           print("You are eligible to be a Representative.")
       #if citizenship is less than 7
       else:
           print("You are not eligible to run for Congress.")
   #if age less than 25
   else:
       print("You are not eligible to run for Congress.")

#calling main function      
main()

OUTPUT

CODE SCREEN SHOT

Add a comment
Know the answer?
Add Answer to:
Important: This code must be written without the use of <and> or range. Create the Congress...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write in python code Project 11-1: Birthday Calculator Create a program that accepts a name and...

    Write in python code Project 11-1: Birthday Calculator Create a program that accepts a name and a birth date and displays the person's birthday the current day, the person's age, and the number of days until the person's next birthday Console Birthday Calculator Enter name: Joel Enter birthday (MM/DD/YY): 2/4/68 Birthday: Sunday, February 04, 1968 Today: Joel is 48 years old. Joel's birthday is in 73 days Tuesday, November 22, 2016 Continue? (y/n): y Enter name: Django Enter birthday (MM/DD/YY):...

  • In this lab, you use the pseudocode in figure below to add code to a partially...

    In this lab, you use the pseudocode in figure below to add code to a partially created Python program. When completed, college admissions officers should be able to use the Python program to determine whether to accept or reject a student, based on his or her class rank. Summary In this lab, you use the pseudocode in figure below to add code to a partially created Python program. When completed, college admissions officers should be able to use the Python...

  • + Run C Code IMPORTANT: • Run the following code cell to create the input file,...

    + Run C Code IMPORTANT: • Run the following code cell to create the input file, biostats.csv, which you will be using later. 74, In [ ]: N %%file biostats.csv Name, Sex, Age, Alex, M, 41, Bert, M, 42, Dave, M, 39, Elly, F, 30, Fran, F, 33, Jake, M, F, Luke, M, 34, F Myra, M, M, 38, Ruth, F, 28, 22 22 323 47 47, Height, Weight 170 200 167 70 115 143 139 280 98 75, 350...

  • given code: assignment: use python to extend the given code to create an output similar to...

    given code: assignment: use python to extend the given code to create an output similar to the one in the black box please explain the final code import random HALMst N in = int(input('Enter Total Number of Cards: ") NM in NOON A = [] B [] E - [] D = [] E = [] for i in range(1, n+1): A.append(i) D.append(i) E.append(i) for j in range(n): 8.append(random.choice(D)) D.remove(B[5]) C.append(random.choice(E)) E.remove(C[j]) c= 0 for k in range(n): if (Brkl...cikl):...

  • Please write this code in JAVA lang., thank you! Your spouse's cousin's nephew's dog's trainer's ...

    Please write this code in JAVA lang., thank you! Your spouse's cousin's nephew's dog's trainer's best friend owns a restaurant. That person is very bad at math and recently discovered that most customers have been significantly undercharged for meals. You have been approached to create a computer program that will accurately calculate bills for each customer. Kids, under 5, eat free. Teens and seniors get a 25% discount. Also, Food and beverage is taxed at 5%. No tax for anything...

  • I am writing a Python program to serve as a fitness tracker. I would love some...

    I am writing a Python program to serve as a fitness tracker. I would love some input as to how you would code this. I've included what I want this program to accomplish, what I will keep track of, and below all of that I have posted the assignment guidelines. Any suggestions on how to make this better/ more efficient would be welcome! I'm thinking of making a weekly tracker that takes input per day, and outputs at the end...

  • Please write this code in JAVA lang., thank you! Your spouse's cousin's nephew's dog's trainer's best...

    Please write this code in JAVA lang., thank you! Your spouse's cousin's nephew's dog's trainer's best friend owns a restaurant. That person is very bad at math and recently discovered that most customers have been significantly undercharged for meals. You have been approached to create a computer program that will accurately calculate bills for each customer. Kids, under 5, eat free. Teens and seniors get a 25% discount. Also, Food and beverage is taxed at 5%. No tax for anything...

  • Written in Python In this lab, you are to build a trivia game. The game should...

    Written in Python In this lab, you are to build a trivia game. The game should present each question – either in order or randomly – to the player, and display up to four possible answers. The player is to input what they believe to be the correct answer.   The game will tell the player if they got it right or wrong and will display their score. If they got it right, their score will go up. If they got...

  • everything explain in the last pic i need a summer for the pags thank u workforce....

    everything explain in the last pic i need a summer for the pags thank u workforce. [3] Health Care in a Global Context HANDS OFF MY HEALTH CARET The United States is one of the world's only developed nations that does not guarantee universal health coverage for its citizens. (31) In 2005 the United States and the other member states of the World Health Organization signed the World Health Assembly resolution 58.33, [16] which stated that nations should "transition to...

  • # In this file, fill in the ... parts with lines of code. Do not # create new functions. from ran...

    # In this file, fill in the ... parts with lines of code. Do not # create new functions. from random import seed, randrange P=[" ♟♜♝♞♛♚"]; L,R,BL,TL=["▌▐▄▀"] BonR=WonR=WonB=DonR=DonB=RonB=GonR=GonB=RonG='\033[1;m\033[' WonR+='7;31;47m' # For drawing a white piece on a red background WonB+='7;30;47m' # For drawing a white piece on a black background DonR+='2;37;41m' # For drawing a dark piece on a red background DonB+='2;37;40m' # For drawing a dark piece on a black background GonR+='2;33;41m' # For drawing gold on a red...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT