Sample+program
-
Upload
ervaishali -
Category
Documents
-
view
216 -
download
0
Transcript of Sample+program
-
8/16/2019 Sample+program
1/1
Chapter 2:
My first program in python.
1. Write a program to to print a sample text as shown,
This is Python
and hope you are a programmer.Who wants to learn me?
2. Write a program to get the following output?
w w
w w w
w
w w w
w w
The first and last lines have tab as spae between them.
!."ow to write multiple statements on a single line?
#.Write a program to provide following output
hello $hi$ bye $why$
%.Write a program to show doumented omments in the Program.
&nswers'
1.
()*usr*bin*python
print +++This is Python
and hope you are a programmer.
Who wants to learn me?+++
2.
()*usr*bin*python
print +wtw+
print + w w w+
print + w+
print + w w w+ print +wtw+
!.
-y seperating them with ++
#.
()*usr*bin*python
print +hello $hi$ bye $why$+
%.
()*usr*bin*python print //do//