Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

My very basic python program will not work and I don't know why maybe I am blind and tired but I can't tell

why do i get this error for this:

prisoners = input('How many player(s): ')
print = ('Welcome to Prison break!')
if int(prisoners) == 1:
    print('Welcome solo player, bravest of the brave')
elif 2 <= int(prisoners) <5 :
    print('Welcome prisoners, hold on to each other tight')
elif 1 > int(prisoners):
    print('Whoops, this game is 1-4 players. ')
elif 4 < int(prisoners):
    print('Whoops, this game is 1-4 players. ')



err:raceback (most recent call last):
  File "/Users/aiyoobaman/Documents/vscode/stuff.py", line 7, in <module>
    print('Welcome solo player, bravest of the brave')
TypeError: 'str' object is not callable

Please help.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You need to change the second line

prisoners = input('How many player(s): ')
print('Welcome to Prison break!')
if int(prisoners) == 1:
    print('Welcome solo player, bravest of the brave')
elif 2 <= int(prisoners) <5 :
    print('Welcome prisoners, hold on to each other tight')
elif 1 > int(prisoners):
    print('Whoops, this game is 1-4 players. ')
elif 4 < int(prisoners):
    print('Whoops, this game is 1-4 players. ')
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading