0% found this document useful (0 votes)
4 views

Python CHINMAY Lab Exp1

The document is a lab assignment for a Bachelor of Technology program focused on programming in Python. It includes a series of questions and solutions related to Python basics, such as string manipulation, variable declaration, and printing formatted outputs. The assignment is submitted by a student named Chinmay Khare to Dr. Bhavana Kaushik at UPES, Dehradun for the Jan-May 2025 semester.

Uploaded by

chinmaykhare87
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Python CHINMAY Lab Exp1

The document is a lab assignment for a Bachelor of Technology program focused on programming in Python. It includes a series of questions and solutions related to Python basics, such as string manipulation, variable declaration, and printing formatted outputs. The assignment is submitted by a student named Chinmay Khare to Dr. Bhavana Kaushik at UPES, Dehradun for the Jan-May 2025 semester.

Uploaded by

chinmaykhare87
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

s

Programming in Python
Lab Assignment

Bachelor of Technology

Submitted by

Name: Chinmay khare Roll No. 590017049

Submitted to
Dr. Bhavana Kaushik

UPES
Bidholi, Via Prem Nagar, Dehradun, Uttarakhand
Jan-May– 2025
S. No. Experiment Page No Student Marks Faculty
Number Sign Sign
1 1 2-5

Lab Experiment 1

Question 1: Install Python and understand difference between scripting and interactive
modes in IDLE.

Solution:

Question 2: Write Python programs to print strings in the given manner:


a) Hello Everyone !!!
b) Hello
World
c) Hello
World
d) ‘ Rohit’ s date of birth is 12\05\1999’

Solution:

a) print("Hello Everyone!!!")
b) print("Hello\nWorld ")
c) print("Hello\n\tWorld")
d) print("‘ Rohit’ s date of birth is 12\\05\\1999’")

Question 3: Declare a string variable called x and assign it the value “Hello”.
Print out the value of x
Solution:

x="Hello"
print(x)
Question 4: Take different data types and print values using print function.

Solution:

x="Hello"
y=109
print(x,y)

Question 5: Take two variable a and b. Assign your first name and last name.
Print your Name after adding your First name and Last name together.
Solution:

a="Chinmay"
b="khare"
print(a+b)

Question 6: Declare three variables, consisting of your first name, your last
name and Nickname. Write a program that prints out your first name, then
your nickname in parenthesis and then your last name.

Solution:

Cod
a=”Chinmay”
b="Khare
c = "runjhun"
print(a+' ( '+c+' ) '+b)
Question 7: Declare and assign values to suitable variables and print in the
following way :
NAME : CHINMAY KHARE
SAP ID : 500017049
DATE OF BIRTH : 20 MARCH 2006
ADDRESS : UPES Bidholi Campus Pincode : 248007
Programme : AI & ML
Semester : 2

Solution:

Name = "CHINMAY KHARE"


Sap = "590017049"
Dob = "20 MARCH 2006"
Add = "UPES\nBidholi Campus\nPincode: 248007"
Programme = "B.Tech CSE"
Semester = "2"
print(" Name:",Name,'\n','SAP ID: ',Sap,'\n','DATE OF BIRTH: ',Dob,'\
n','ADDRESS: ',Add,'\n','Programme: ',Programme,'\n','SEMESTER:',Semester)

You might also like