Home / MCQ Bank / Computer
Computer Classes And Objects In Python

What will be the output of the following Python code? def add(c,k): c.test=c.test+1 k=k+1 class A: def __init__(self): self.test = 0 def main(): Count=A() k=0 for i in range(0,25): add(Count,k) print("Count.test=", Count.test) print("k =", k) main()

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option C • Count.test=25 k=0

Related Computer Questions

An example of a medium-speed, switched communications service is Which of the following is not a part of an email address? What is the primary purpose of a learning rate in training machine learning models? A view is which of the following? What will be the output of the following C++ code? #include <iostream> #include <string> using namespace std; int main(int argc, char const *argv[]) { string s1 = "Hello"; string s2 = "World"; string s3 = s1 + " " + s2; cout<<s3; return 0; }