Monday, June 14, 2021

# 2. a. Python basic operation practice questions solutions

 

Basic operation practice questions solutions





1. Write a python program to print your name?

#   printing my name 

print('Divya')

    OUTPUT: 

   Divya

 2. Write a python program on a conversation between two friends about how did they spend school holidays? 

# printing conversation

print('Sania: How are you Suma?')

print('Suma: I am fine, Sania. What about you?')

print('Sania: I am fine too. So school has started again and how was your holiday?')

print('Suma: My holiday was amazing. I went for a family picnic and visited a few of my relatives.')

print('Sania: That seems interesting. Where did you go for the picnic?')

print('Suma: We went to Rajasthan. We stayed there for three days in a resort. We spend a night camping near a desert.')

print('Sania: So you have done so much adventure.')

print('Suma: Yeah, that was adventurous.')

print('Sania: I visited my uncle and grandmother in the village.')

print('Suma: How was your visit?')

print('Sania: That was so much fun. I have lots of cousins there.')

print('Suma: It seems your holiday was also amazing.')

print('Sania: Yeah, it was. Thanks for sharing your experience.')

print('Suma: You are welcome Sania. Take care, see you.')

OUTPUT:

Sania: How are you Suma?
Suma: I am fine, Sania. What about you?
Sania: I am fine too. So school has started again and how was your holiday?
Suma: My holiday was amazing. I went for a family picnic and visited a few of my relatives.
Sania: That seems interesting. Where did you go for the picnic?
Suma: We went to Rajasthan. We stayed there for three days in a resort. We spend a night camping near a desert.
Sania: So you have done so much adventure.
Suma: Yeah, that was adventurous.
Sania: I visited my uncle and grandmother in the village.
Suma: How was your visit?
Sania: That was so much fun. I have lots of cousins there.
Suma: It seems your holiday was also amazing.
Sania: Yeah, it was. Thanks for sharing your experience. 
Suma: You are welcome Sania. Take care, see you.




3. Write a program to print your favorite song lyrics?

# BELIEVER is my favorite song 

# to print multiple lines of text I used triple single quotes

print('''First things first

I'ma say all the words inside my head

I'm fired up and tired of the way that things have been, oh-ooh

The way that things have been, oh-ooh

Second thing second

Don't you tell me what you think that I could be

I'm the one at the sail, I'm the master of my sea, oh-ooh

The master of my sea, oh-ooh

I was broken from a young age

Taking my sulking to the masses

Writing my poems for the few

That look at me, took to me, shook to me, feeling me

Singing from heartache from the pain

Taking my message from the veins

Speaking my lesson from the brain

Seeing the beauty through the...

Pain!

You made me a, you made me a believer, believer

Pain!

You break me down and build me up, believer, believer

Pain!

Oh, let the bullets fly, oh, let them rain

My life, my…''')

OUTPUT:

First things first
I'ma say all the words inside my head
I'm fired up and tired of the way that things have been, oh-ooh
The way that things have been, oh-ooh
Second thing second
Don't you tell me what you think that I could be
I'm the one at the sail, I'm the master of my sea, oh-ooh
The master of my sea, oh-ooh
I was broken from a young age
Taking my sulking to the masses
Writing my poems for the few
That look at me, took to me, shook to me, feeling me
Singing from heartache from the pain
Taking my message from the veins
Speaking my lesson from the brain
Seeing the beauty through the...
Pain!
You made me a, you made me a believer, believer
Pain!
You break me down and build me up, believer, believer
Pain!
Oh, let the bullets fly, oh, let them rain 

My life, my… 

Project 1:

In an IT company, an interview is conducted to recruit python freshers. In the first round of interview, HR asked the student a question regarding the student’s daily activities. By using the python print function write a program on daily activities line by line.

# telling daily activities to HR in interview

print(""" Well, I wake up at 4.30 am.

After taking bath, I pray to God then I prepare breakfast and lunch.

After that, I do house hold works which keeps me busy till 7.30 am. 

After taking my breakfast I check my emails, do internet surfing, apply to jobs.

then I went to training at anna nagar and I return back at 6.30 pm. Then I take my evening tea.

After returning home I prepare dinner and go to bed.

But, if I have an interview scheduled for the day I priorities my work accordingly. """)

OUTPUT:

Well, I wake up at 4.30 am.
After taking bath, I pray to God then I prepare breakfast and lunch.
After that, I do house hold works which keeps me busy till 7.30 am. 
After taking my breakfast I check my emails, do internet surfing, apply to jobs.
then I went to training at anna nagar and I return back at 6.30 pm. Then I take my evening tea.
After returning home I prepare dinner and go to bed.
But, if I have an interview scheduled for the day I priorities my work accordingly.




THANK YOU FOR VISITING
HAPPY CODING😊





No comments:

Post a Comment

# 7. Type conversion in Python

                                      Type Conversion in Python Python defines type conversion functions to directly convert one data type t...