This section contains carefully selected MCQs and Previous Year Questions with explanations to help students understand concepts and prepare effectively for examinations, interviews, and competitive tests.
Q: 1The given declaration statement in Python Language belongs to which data type?
>>>Student ={‘SUBJECT’ : ‘Compiler’, ‘Marks’ : ‘50’, ‘Grade’ : ‘C’}
Option D
In Python, a Dictionary is a data type used to store data in the form of key–value pairs. Dictionaries are enclosed within curly braces { }. Each key is associated with a value using a colon : (colon).
In the given statement Student = {'SUBJECT':'Compiler', 'Marks':'50', 'Grade':'C'}
Q: 2What will be the output of the following Python code?
a = True
b = False
c = False
if not a or b:
print(1)
elif not a or not b and c:
print(2)
elif not a or b or not b and a:
print(3)
else:
print(4)
Option C
The precedence of logical operator in Python is:
Q: 3What is output of the code in Python Language:
>>> str1 = ‘All the Best’
>>> str1[-3]
Option B
In Python, negative indexing is used to access characters from the end (right side) of a string.
| Positive Index | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Character | A | l | l | t | h | e | B | e | s | t | ||
| Negative Index | -12 | -11 | -10 | -9 | -8 | -7 | -6 | -5 | -4 | -3 | -2 | -1 |
The character at index str1[-3] is 'e'.
Q: 4Which one is NOT a feature of Python Language?
Option C
Python is a popular high-level programming language known for its simplicity and readability. It is a high-level, interpreted language and portable across different operating systems.
However, Python is case-sensitive language. This means uppercase and lowercase letters are treated differently.
>>>name = "Suresh"
>>>Name = "Rampayari"
>>print(name)
>>>print(Name)
Here, name and Name are treated as two different variables.
Q: 5What is the meaning of >>> in Python Language?
Option C
In Python, the symbol >>> is called the Python Prompt. It appears in the Python interpreter when Python is ready to accept and execute commands entered by the user.
It indicates that the interpreter is active and waiting for instructions.
Thank you so much for taking the time to read my Computer Science MCQs section carefully. Your support and interest mean a lot, and I truly appreciate you being part of this journey. Stay connected for more insights and updates! If you'd like to explore more tutorials and insights, check out my YouTube channel.
Don’t forget to subscribe and stay connected for future updates.