Just started learning python, and am looking for some simple exercises to practice with.
Any exercises incorporating any, or all of the above would be awesome.4 AnswersProgramming & Design6 years ago
I'm learning python, and I'm having a little trouble with an exercise.
Essentially, I am trying to define a function with one argument. This function will take the string that I input, and if the letter is a consonant add an o and the same consonant after, if it is a vowel it won't do anything.
e.g. function(tiger) would display totigogeror
This is my code:
vowels = ['a', 'e', 'i'. 'o', 'u']
for i in var:
if i in vowels:
print i + 'o' + i
which gives me
How can I adjust my code to output the results all on one line? I was thinking that a continue loop might work better than a for loop but I'm confused as to how I should write it.
Anyway, thanks.1 AnswerProgramming & Design6 years ago
Today my world goes up in flames
A chorus line of false angels commence my silence
Sent by God to ensure my loneliness
My malcontent surrounds me
Filling my lungs with the toxic fumes of resent
Resent for what you have done
Resent for what I.. have not
As I watch my world burn to the ground
God, his angels and you laugh
At the pitiful excuse of a man
Crying in the shadow of his world, torn to pieces
If God could cast my faith aside
If you could forgo my love
What more is there for me in this life?
I lay my soul to rest
As I hang my head in despair
The noose is tied around my neck
Who will it be?
Who will push me past the brink?
You gladly volunteer to do the deed
I have but one request:
That you look me in the eyes
So that I may share in your content
If only for a brief moment,
I shall share a feeling of happiness in this life
The last thing I want to see are your beautiful eyes
Like diamonds: brilliant yet cold
You feel no remorse as you send me to my death
You leave me to burn alongside my world of hopes and dreams
All that remains is the hope that you will one day see
The error of your ways1 AnswerPoetry6 years ago
Poem I revised after a few years, more imagery, more sophisticated vocabulary. Feedback appreciated!?
As the last golden rays of Friday’s summer sun fade into night
My eyelids grow heavy and I drift into the unconscious realm of sleep,
Of my wandering imagination
Reflecting upon our time together – how short it was
Hours flew by like seconds, as if in a state of hyper-awareness
Your beauty – unrivaled by even the most exquisite renaissance masterpiece
Like memories of ones once loved
Impenetrable and invincible to the test of time
Much changes with the passing of the seasons
Trees shed their wondrous, technicolor leaves
Daffodils and tulips begin to bloom anew
Yet you remain unchanging
As pure and gracious as the day we first met
But that ship has long since set sail to new lands
Only a distant memory in the vast sea that is my soul
One that shall endure unto the end of time
My heart pulls me close to you
With the intensity of a raging fire – burning bright in the night
I wish only that it be reciprocated
And yet it only seems to repel
Hours now pass like days – days like weeks
Impatiently I count each consequent second
Like a metronome – I soon become unnoticed
Waiting for the chance to witness your beauty one last time
For without you there is no grace in my life
No reason to keep up the struggle
My beating heart – the incessant tick-tock of my life’s clock
Winding down to an inevitable bitter end3 AnswersPoetry6 years ago
Endings are life’s greatest inevitability
Much like the climactic battle scene of a movie rolling its credits,
Everything eventually draws to a close
Whether it be the dawning of a blustery winter’s day,
Or the first moments of the most breathtaking autumn sunset
Whether it is the toughest test ever taken,
Or the simplest of games played among friends
Necessitates an ending
Therefore, so too must life
Come to its own bitter-sweet end.2 AnswersPoetry6 years ago
There's a girl and for all intensive purposes it didn't work out.
I've typed up a letter I want to send to her. The letter explains the situation between us, how it got to the point it's at, how I feel about the situation and how I feel about the her. Unfortunately I need closure to move forward and I feel this is the only way I'm going to get it (I've tried other things before). I also, unfortunately, think that this letter may unnerve her: to what point, I'm not sure. Is my getting closure worth unsettling her? She's done nothing explicitly wrong, but the situation is quite upsetting to me.
I've tried to just forget about it and put it behind me but because I don't know what her feelings are I just keep coming back to it. There is nothing in the letter that I believe would offend her, or even could offend her. I just put a lot of emotion into it and I think she may be a little uneasy about it.
I realize this is essentially a repost of my previous question but I felt I didn't explain clearly enough.3 AnswersSingles & Dating9 years ago
I've typed up a letter I want to send to someone. The letter explains the situation between us and how I feel about it. Unfortunately I need closure to move forward and I feel this is the only way I'm going to get it (I've tried other things before). I also, unfortunately, think that this letter may unnerve the person: to what point, I'm not sure. Is my getting closure worth hurting the other person? They've done nothing explicitly wrong to me, but the situation is quite upsetting to me.4 AnswersMental Health9 years ago
I love her and can't get her out of my head... I know she doesn't feel the same. I had a dream about her last night. In the dream I felt happy. I'm up now and can't stop thinking of her. She means a lot to me and I don't want to lose her. I told her how I felt about her and got no response (she lives too far to see often in person).
How can i deal with this? Anything I can say to her? How can I move on and forget my feelings for her?2 AnswersSingles & Dating9 years ago
I've been texting her for about a week now. I happen to be heading down to near where she lives on Friday and suggested we meet for a coffee. She said she was busy and to tell her what days worked for me. I told her the weekends are good for me and she replied that she usually worked those days. I then said that I'm sure we could work something out eventually and she replied ":)" ...
Is she honestly interested in meeting up? I'm confused..5 AnswersSingles & Dating9 years ago
I'm a guy going to an 18 and under dance at a club in my city. I want to be noticed by girls there. I was considering wearing dark blue jeans, a black button-up dress shirt, tie, vest and some nice high-top shoes. Do you think that's too formal? Any suggestions as far as types of clothing? I'm also gonna wear a nice belt and watch as well as cologne so don't need suggestions as far as that goes.
Thanks guys!!2 AnswersFashion & Accessories9 years ago
How can I change the conversation from serious to fun? Been texting a girl and we got into talking about university plans. I'd like to change the topic to something more light-hearted (there are only so many interesting things I have to say about her program, I know very little about). I was thinking just texting her something completely off topic and seeing how she responded but I don't want to lose her interest either.
Any ideas?2 AnswersFriends9 years ago
What do these lyrics mean to you?
I've seen so many girls, I've heard so many lines
And once or twice I thought, that one of them was mine
Well how it always goes and how it's always been
I start to think that we'd be better off if we were friends
But there's a new turn, yeah there's a new twist
I know I said before that I just couldn't handle this
I'm not the type to write you love songs
Oh it'd help if somebody sang along
Tell me, tell me, tell me anything
And I will believe you
Tell me, tell me, tell me not to go
And I will never leave you
Tell me, tell me, tell me I'm yours
Tell me that you're the same
Tell me, tell me, tell me, tell me
Anything3 AnswersLyrics9 years ago
I want to tell a friend of mine that I like her. I would do it in person but we live quite far apart and don't really have much opportunity to see each other. There is a possibility that she may move to Japan in a few months and I don't think I'll see her before that.
We haven't known each other that long and I want to tell her that I have feelings for her and that I'd like to get to know her better. I'm very hesitant because I know this isn't really something that's appropriate to tell someone over facebook chat.
How should I let her know that I like her but that I want to get to know her better regardless of her feelings for me? I've tried typing it out many times but it always sounds too blunt and insincere.
I don't want this to ruin our friendship but I can't ignore my feelings for her and live regretting not having told her when I could.
Please, any suggestions are greatly appreciated.6 AnswersFriends9 years ago
I'm really depressed right now. I turned 18 a little while ago and only 1 of my really close friends wished me a happy birthday and other than my grandmother, none of my family wished me a happy birthday either. My parents fight all the time and when I try to do something about it I get yelled at for getting in the middle of it. The girl I like and one of the only girls I enjoy being with lives 3 hours away and I never see her. She might be moving to Japan in a few months and I may never see her again.
It seems the only things that keep me going right now are clinging to the hope that the girl I may never see again has feelings for me and alcohol: which I hate myself for drinking.
No, I'm not underage anymore.. the drinking age is 18 where I live
Anybody out there suffer from depression and know what might help?3 AnswersOther - Health9 years ago
Long story short, there's a girl I really like. The last time I saw her was in August, because we live a fair distance from each other. Next year we're both going to university, her possibly in Japan, which is only going to increase the distance between us. I have no clue when I'd be able to see her next because we're both incredibly busy with school and me with work as well. I wanted to tell her about my feelings for her in person, but an opportunity to do so may never present itself.
I have her facebook and phone number but I don't think it'd be a good idea because we haven't talked face-to-face in a long time, and it might seem weird.
What are your opinions?3 AnswersFriends9 years ago
As Friday disappears with the setting of the sun
My eyes close as I drift into the unconscious realm
Of my imagination
To reflect upon our time together... How short it was
The hours flew by like seconds
The beauty of your image engraved in my mind;
As the words on the tombstone of one once loved
Impenetrable and invincible to the test of time
So much changes with the passing of each year
The trees have shed their leaves
And the daffodils begin to bloom anew
Yet you remain unchanged
As pure and gracious as the day we first met
But that ship has set sail to a new land
Only a distant memory in the sea that is my soul
One that shall remain unto the end of time...
Your heart pulls me close to you
With the intensity of the setting sun’s last gleaming beacon
I wish only for mine to do the same
And yet my heart only seems to repel
Hours turned into days, to weeks, to months
Impatiently I counted each and every second
Like a metronome, I soon became unnoticed
Waiting for my chance to see you one more time
For without you there would be no grace in my life
No reason to keep struggling to live
My beating heart, the incessant tick-tock of my life’s clock
Winding down to the bitter end
I know there is room for improvement, now I need your help to find out where.
Please respond with anything you think I could do to improve this poem :) thanks!5 AnswersPoetry9 years ago