1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Incrementing input each time

Discussão em 'Python' iniciado por Stack, Dezembro 19, 2024.

  1. Stack

    Stack Membro Participativo

    I Want to increment the user input by 1 each time so the output displays

    • score for game 1 score for game 2 score for game 3 and so on

    This prompt is repeated depending on how many games user has entered at the start, Anyway it might be an easy fix but cant seem to get it right, I am a newbie :) any help would be appreciated TIA

    n = int(input("enter total number of games "))
    games = []
    for i in range(n):
    x = int(input("score for game 1 ")) #this line!#
    games.append(x)
    print("total Points is ", sum(games))
    average_score = sum(games) / n
    if average_score <=15:
    print("Average Score per game is ",round(average_score, 2) , "really poor! better luck next time")
    elif average_score >= 16 and average_score <=18:
    print("Average Score per game is ",round(average_score, 2), "Well done!")
    else:
    print("Average Score per game is ",round(average_score, 2), "Amazing result, you could be top 3! ")



    I have tried adding an increment in append. But that dont work

    Continue reading...

Compartilhe esta Página