0

why wont it print suggest something

class Word_Game: class Race: races={"Goblin","Elf","Mage","Warrior"} def getting_input(): a=Word_Game.Race.races tada=input("Enter the class you want to choose:") for i in a: if tada in a: print("You have choosen to be "+tada) return tada else: print("Pick the available characters ") getting_input() print("Inside class") def __init__(self,name): print("inside init") self.name=name about=self.name print("You have choosen to be "+getting_input()) class Goblin(Race): def goblin(self): des="A greedy creature" hp=5 mana=0 return '{0}"\n"{1}"\n"{2}'.format(des,hp,mana)

27th Sep 2017, 1:33 PM
Bounty Hunter
Bounty Hunter - avatar
9 ответов
+ 2
Insert the code file in the reply. The above code is tough to comprehend.
27th Sep 2017, 2:26 PM
Mayur Garg
Mayur Garg - avatar
+ 2
ohh god😂😂 Not like this.. You dont know how to use SoloLearn.
27th Sep 2017, 2:28 PM
Mayur Garg
Mayur Garg - avatar
+ 2
Go to SoloLearn app's home page. choose the 4th tab click the plus icon. choose python and paste your code there. save that code and make it public. come back to this discussion. when you reply, you will see a ' + Insert... ' option. choose that and then your code. and then click post.
27th Sep 2017, 2:31 PM
Mayur Garg
Mayur Garg - avatar
+ 2
The main reason it isnt printing anything is because you havent asked it to. Everything is inside the class definition. You havent called anything or made any object. This is just a definition of classes and their functions.
27th Sep 2017, 2:34 PM
Mayur Garg
Mayur Garg - avatar
+ 1
It is tough to understand the actual identation and hence the code here.. Put your code in the code playground and save it to your profile and then add the link here using the Insert option in the reply.
27th Sep 2017, 2:22 PM
Mayur Garg
Mayur Garg - avatar
+ 1
lol first time asked a question 😂😂😂
27th Sep 2017, 2:29 PM
Bounty Hunter
Bounty Hunter - avatar
0
here's what the question is about I created a race class and in the word game class I tried printing races tuple in the getting input method but I couldn't
27th Sep 2017, 2:24 PM
Bounty Hunter
Bounty Hunter - avatar
0
class Word_Game: class Race: races={"Goblin","Elf","Mage","Warrior"} def getting_input(): a=Word_Game.Race.races tada=input("Enter the class you want to choose:") for i in a: if tada in a: print("You have choosen to be "+tada) return tada else: print("Pick the available characters ") getting_input() print("Inside class") def __init__(self,name): print("i
27th Sep 2017, 2:28 PM
Bounty Hunter
Bounty Hunter - avatar
0
I've created object but the line you have chosen to be +getting input doesn't seem to run
27th Sep 2017, 2:38 PM
Bounty Hunter
Bounty Hunter - avatar