First Year Computer Science - Chapter 2 Python
Programming
This PDF contains short questions, MCQs, and solved Python programs for First Year Computer Science Chapter 2.
Short Questions
Q: What is Python?
Ans: Python is a high level programming language.
Q: What is a Variable?
Ans: A variable is used to store data.
Q: What are Data Types?
Ans: Common data types are int, float, str, and bool.
Q: What is a Comment?
Ans: Comments explain code and start with #.
Solved Programs
Hello World
print("Hello World")
Addition of Two Numbers
a = 5
b = 3
print(a + b)
Square of Number
num = int(input("Enter number: "))
print(num * num)
Area of Rectangle
length = int(input("Enter length: "))
width = int(input("Enter width: "))
print(length * width)
Important MCQs
Question Correct Answer
Python is a ____ language. High level language
Comments in Python start with? #
Which function displays output? print()