182,795 views
13 votes
13 votes
I'm trying to run this program, but it keeps giving an 'unexpected EOF while parsing.' If anyone can help me, I'll be blessed.

print("Welcome Everyone! We're here today to watch the elections for HoR (House of Representatives)! Here's our first Congressman/woman now.")
print("Answer the following questions or press 'Q' to quit")
name = input("Enter your name: ")
print("Welcome to the Congressional Elections", name + "!")
if name == 'Q':
print ("You've chosen to quit this program. Goodbye.")

Age = input("Enter Age: ")
try:
checker = int(Age)
if checker >= 25:
print(name + " can run for Congress")
break
else:
print(name + " cannot run for Congress")

User Chris Wheeler
by
2.5k points

2 Answers

19 votes
19 votes

Answer:

Your try and except statement

Step-by-step explanation:

You have a try statement but no except to go with it, which causes an error. Not to mention, you do not need to use break because it causes an error and you are not in a loop. You are already using an if-else statement.

To improve your code, you do not need to create a new variable checker and instead just do

Age = int(input("Enter Age: "))

if age >= 25:

# >> do the below

I also recommend you use \\ to create newlines instead of using print for each line.

User Meyertee
by
2.8k points
7 votes
7 votes

Answer:

Step-by-step explanation:

As a math teacher, Florence frequently makes photocopies of fun activities for her students to do. When the copies come out of the copy machine, they form a stack.

This table shows the relationship between the number of copies in the stack, x, and the height (in millimeters) of the stack, y.

x (copies) y (millimeters)

25 1

50 2

75 3

100 4

According to the values in the table, do x and y have a proportional relationship?

yes

no

Questions

answered

26

Time

elapsed

00 12 42

HR MIN SEC

SmartScore

out of 100

68

Need a break?

Work it out

Not feeling ready yet? This can help:

Find the constant of proportionality from a table

Company | Blog | Help center | User guides | Tell us what you think | Testimonials | Contact us | Terms of service | Privacy policy

IXL Learning © 2021 IXL Learning. All rights reserved.As a math teacher, Florence frequently makes photocopies of fun activities for her students to do. When the copies come out of the copy machine, they form a stack.

This table shows the relationship between the number of copies in the stack, x, and the height (in millimeters) of the stack, y.

x (copies) y (millimeters)

25 1

50 2

75 3

100 4

According to the values in the table, do x and y have a proportional relationship?

yes

no

Questions

answered

26

Time

elapsed

00 12 42

l rights reserved.v

User TheCuBeMan
by
2.8k points