Python CHINMAY Lab Exp1
Python CHINMAY Lab Exp1
Programming in Python
Lab Assignment
Bachelor of Technology
Submitted by
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:
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: