Python Forum
Need help with iteration homework
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help with iteration homework
#2
Please use python tags when posting code. See the BBCode link in my signature below for instructions.

First you need to fix your syntax and indentation errors. The if and else statements should all be at the same indentation level as the first input. There is no "else if" in Python, it is "elif". And you can't use break outside of a loop.

Next, if they are entering a character, why are converting it to an int? And note the missing close parentheses at the end of that line. Also, you store the value in n, but you are checking against int (a built-in function).
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Need help with iteration homework - by Dendro - Oct-18-2018, 12:35 AM
RE: Need help with iteration homework - by ichabod801 - Oct-18-2018, 01:47 AM
RE: Need help with iteration homework - by stullis - Oct-18-2018, 02:53 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Homework (counting iteration issue) Cardinal07 10 5,720 Feb-26-2018, 04:45 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020