0% found this document useful (0 votes)
3 views1 page

Python User Interaction Exercises

The document outlines a series of Python lab exercises focused on user interaction. It includes tasks such as printing messages, taking user inputs, and performing calculations related to geometry. The exercises are designed to help users practice basic Python programming concepts and syntax.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Python User Interaction Exercises

The document outlines a series of Python lab exercises focused on user interaction. It includes tasks such as printing messages, taking user inputs, and performing calculations related to geometry. The exercises are designed to help users practice basic Python programming concepts and syntax.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CETPA PYTHON LAB EXERCISES

TOPIC : USER INTERACTION


1. Print Hello world!
2. Print 5 adjacent Stars in Single Line using 5 print statements.
3. Print 5 space separated stars in Single line using 5 print statement.
4. Print the Nos 1 to 5 at screen with a gap of two lines in between using 5 print
statements.
5. Take two inputs from the user and check their data types.
6. Take the radius of a circle from a user as integer and print the area and
circumference of the circle.
7. Take the length and width of a rectangle from a user as float value and print the
area, diagonal length and perimeter of the rectangle.
8. Take variables a,b,c,d,e,f = 2,3,4,5,6,7 Run the following statements and
validate the outputs.
• print(a,b,c,d,e,f,sep="cetpa",end="*")
• print(a,b,c,sep="#",end="abc")
print(d,e,f,sep="\n")
• print(a,b,sep="#")
print(c,d,sep="\t\t\t",end="\n\n\n")
print(e,f)
• print(a,b,c)
print(d,sep="cetpa")
print(e,f,end="CETPA")
• print(a,b,c,sep="",end="456")
print(d,end="")
print(e,f,sep="$")
• print(a,b,c,sep="5",end="\t\t\t")
print()
print(d)
print(e,f,sep="",end="")

CETPA INFOTECH PVT. LTD. – No. 1 Training Company


Visit: [Link]

You might also like