1.

Write a program to display your school name,class and section​ in python

Answer»

The following codes must be typed in SCRIPT MODE, saved and then executed.

CODE:

school = input("Enter your school name:")

Class = input("Enter your class:")

section = input("Enter your section:")

print("Your details are", school, "Class", class, "section", section)

OUTPUT:

\tt Enter\ your\ school\ n ame: Westchester High

\tt Enter\ your\ class: 11

\tt Enter\ your\ section: D

\tt Your\ details\ are\  Westchester\ High,\ Class\ 11,\ section\ D

NOTE: Care must be taken when typing "class". "Class" is a keyword in Python programming and will hence not be considered a variable. Capitalizing the first alphabet will change its state to that of a variable (as DONE in the code.)



Discussion

No Comment Found