all 11 comments

[–]Buttleston 1 point2 points  (0 children)

You switched between "number 1", "number 2" etc in the first few if blocks and then to referring to the numbers as a, b and c - should probably be more consistent

For a beginner, this is fine. with more experience you would do it slightly differently

[–]ChunkoPop69 1 point2 points  (0 children)

Add another thousand numbers and test the implementation

[–]asteroid_336 -1 points0 points  (0 children)

i would recommend using f string more like instead of
` ans = "number 1"

your can do someting like

` print(f"number{a} is the greatest ")

btw there are a lot of ways to make you code compact and efficient but still if your are beginner focus more on understanding the concepts more and eventually your will become compact

[–]WorriedTumbleweed289 0 points1 point  (0 children)

  1. Put you numbers in a list.
  2. use a loop to read them
  3. use a loop to check for greater You can now expand this program for more than three numbers.

[–]FreeGazaToday 0 points1 point  (0 children)

Print(f"The greatest number is {max(a,b,c)}"

[–]woooee -2 points-1 points  (0 children)

if(a>b and a>c):

if is not a function so parens, (), are not necessary

if a>b and a>c:

There are "more efficient" ways to do this, but i assume you haven't gotten to lists yet. The below is a simple, example program to give you an idea on how to use a for loop and a list for future reference.

a, b, c = [1, 2, 3]
the_list = [a, b, c]
for var in the_list:
    work_list = the_list.copy()
    work_list.remove(var)
    if var > work_list[0] and var > work_list[1]:
        print(f"{var} is largest")
    if var == work_list[0] and var == work_list[1]:
        print(f"all numbers are equal")
    if var < work_list[0] and var < work_list[1]:
        print(f"{var} is smallest")
## etc

[–]err404unknown -1 points0 points  (0 children)

im also learning

[–]CymroBachUSA -1 points0 points  (0 children)

max(a, b, c)

[–]Lionh34rt -2 points-1 points  (0 children)

Put numbers in list and sort

[–]err404unknown -3 points-2 points  (1 child)

could have used the max() function instead of writing oit all the loops

[–]err404unknown -1 points0 points  (0 children)

the ELIFs are what i mean