I decided to create a madlib program just for fun and here is what I coded.
print 'This is a madlib.'
#obtaining variable data
a = raw_input('Please type a noun:')
b = raw_input('Please type a second noun:')
c = raw_input('Please type a past tense verb:')
d = raw_input('Please type a his/her/herm:')
e = raw_input('Please type a title:')
print 'the' a' and the 'b
'- Hans Christian Anderson'
'ONCE upon a time there was a prince who wanted to marry a 'a'; but she would have to be a real'a'. He 'c 'all over the world to find one, but nowhere could he get what he wanted. There were 'a'es enough, but it was difficult to find out whether they were real ones. There was always something about them that was not as it should be. So he came home again and was sad, for he would have liked very much to have a real'a'.'
'One evening a terrible storm came on; there was thunder and lightning, and the rain poured down in torrents. Suddenly a knocking was heard at the city gate, and the old king went to open it.'
'It was a 'a 'standing out there in front of the gate. But, good gracious! what a sight the rain and the wind had made 'd 'look. The water ran down from 'd 'hair and clothes; it ran down into the toes of 'd 'shoes and out again at the heels. And yet she said that she was a real 'a'.'
'"Well, we will soon find that out," thought the old queen. But she said nothing, went into the bed-room, took all the bedding off the bedstead, and laid a 'b 'on the bottom; then she took twenty mattresses and laid them on the 'b', and then twenty eider-down beds on top of the mattresses.'
'On this the 'a 'had to lie all night. In the morning she was asked how she had slept.'
'"Oh, very badly!" said she. "I have scarcely closed my eyes all night. Heaven only knows what was in the bed, but I was lying on something hard, so that I am black and blue all over my body. It is horrible!"'
'Now they knew that she was a real 'a 'because she had felt the 'b 'right through the twenty mattresses and the twenty eider-down beds.
'Nobody but a real 'a 'could be as sensitive as that.'
'So the prince took 'd 'for his 'e', for now he knew that he had a real 'a'; and the 'b 'was put in the museum, where it may still be seen, if no one has stolen it.'
'There, that is a true story.'
When i ran it, here is what i got:
File "test.py", line 10 print 'the' a' and the 'b ^ SyntaxError: invalid syntax
it didn't even ask me my input. it works when i remove the story.
Can anyone help me?
Thanks in advance.


Sign In
Create Account

Back to top









