Document (7)
Document (7)
A: PyCharm, IDLE.
A: Indentation is the space at the beginning of a code line. It is used to define blocks of
code, especially in loops, functions, and conditionals.
A: input() is used to take input from the user, and print() is used to display output.
A: break, continue.
A: Keywords are reserved words in Python which have special meaning. Example: if, for,
while, def.
Q9: What are identifiers?
A: Identifiers are the names used for variables, functions, classes, etc.
A: A variable is used to store data. It does not need to be declared with a type.
A:
X = 10
If x > 0:
Print(“Positive”)
Elif x == 0:
Print(“Zero”)
Else:
Print(“Negative”)
A: A set is a collection of unordered and unique items. It is defined using curly braces {}.
A: A dictionary stores data in key-value pairs. It is defined using curly braces with keys
and values: {key: value}.
A: append(), remove().
A: return gives back a value to the caller, print() just displays output.
A: It is used to check whether the script is being run directly or being imported.
A:
Import math
Print(math.sqrt(25))
A: Defining multiple methods with the same name but different arguments (not fully
supported in Python, can be handled manually).
A: It is the process where one class can inherit properties and methods of another
class.
A: self refers to the current instance of the class and is used to access variables and
methods.
A: Defining a method in the child class with the same name as in the parent class to
change its behavior.
A:
Class A:
Def show(self):
Print(“A class”)
Class B(A):
Pass
Obj = B()
Obj.show()
A: Pandas is used for data analysis and manipulation. It provides structures like Series
and DataFrames.
A: A DataFrame is a 2D labeled data structure (like a table with rows and columns).
A: tkinter is a GUI library in Python used to create windows, buttons, labels, etc.
A:
Import pandas as pd
S = pd.Series([1, 2, 3])
A: pd.read_csv(‘filename.csv’)
Tkinter:
Q6: What is the use of tkinter?
MySQL:
A: