Prerana Educational and Social Trust®
PES Institute of Technology & Management
NH-206,Sagar Road,Shivamogga-577204
Department of Computer Science and Engineering
ASSIGNMENT 1
2022-23
Academic Year Semester II (CSE stream)
Introduction to Python Programming
Course
BPLCK105B
University Course Code
[Link] S
Course Instructor
PYTHON BASIC PROGRAMS
Design and develop python program to
1) Print "Hello Python"
2) Do Arithmetical Operations
3) Find The Area Of A Triangle
4) Swap Two Variables With And Without Using Third Variable.
5) Calculate Simple Interest
6) Ask for the user’s first name and display the output message
Hello [First Name] .
7) Ask for the user’s first name and then ask for their surname and display the output
message
Hello [First Name] [Surname].
8) Write code that will display the joke “What do you call a bear with teeth?” and
on the next line display the answer “A gummy bear!” Try to create it using only one line of
code.
9) Ask the user to enter two numbers. Add them together and display the answer as
The total is [answer].
10) Write a program to display your date of birth with message
My Date of birth is dd/mm/yyyy
11) Ask the user to enter three numbers. Add together the first two numbers and then
multiply this total by the third. Display the answer as The answer is [answer].
Prerana Educational and Social Trust®
PES Institute of Technology & Management
NH-206,Sagar Road,Shivamogga-577204
Department of Computer Science and Engineering
12) Ask how many slices of pizza the user started with and ask how many slices they have
eaten. Work out how many slices they have left and display the answer in a user
friendly format.
13) Ask the user for their name and their age. Add 1 to their age and display the output
[Name] next birthday you will be [new age].
14) Ask for the total price of the bill, then ask how many diners there are. Divide the total
bill by the number of diners and show how much each person must pay.
15) There are 2,204 pounds in a kilogram. Ask the user to enter your weight in kilograms
and convert it to pounds.
Course Instructor HOD