Here is a python program to print your name, roll number, section, session, and department on the output screen.
Contents
By printing directly
We can print the required data directly using the print() function. Here is the code:
#Python program to print your name, roll number, section, session, and department on the output screen.
# By printing directly
print('Name: Ahmad Shafiq')
print('Roll No: 2021-EE-367')
print('Section: A')
print('Session: 2021')
print('Department: Electrical Engineering')
# This code is contributed by Ahmad Shafiq
By declaring variables
We can also solve the above problem by declaring variables and then printing them by using the print() function.
#Python program to print your name, roll number, section, session, and department on the output screen.
#By declaring variables
name = 'Ahmad Shafiq'
rollNo = '2021-EE-367'
section = 'A'
session = '2021'
department = 'Electrical Engineering'
print('Name:', name, '\nRoll No', rollNo, '\nSection', section, '\nSession', session, '\nDepartment', department)
# This code is contributed by Ahmad Shafiq