Login
Register
Dark Mode
Brightness
Ambient Glow – Questions list
Register
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged programming-in-python
3
3 votes
1
1 answer
213
213 views
Question on for loop
What is the output of the below code snippet?for var1, var2 in (1,2),(3,4): print(var1 + var2, end = " ")(a) 4 6(b) 10(c) 3 7(d) TypeError
sri321
213
views
asked
Aug 26
Programming in Python
python
programming-in-python
python-programming
for-loop
+
–
1
1 vote
1
1 answer
211
211 views
Question on Nested Loops and List Indexing in Python
What is the output of the below code snippet?result = 0 list1 = [10,20,30] list2 = [1,2] for num in range(len(list1)): for num in range(len(list2)): result += list1[num] ...
sri321
211
views
asked
Aug 26
Programming in Python
python-programming
python
programming-in-python
list
for-loop
+
–
0
0 votes
1
1 answer
187
187 views
Question on Call by object reference
What is the output of the below code snippet?def move(list1, list2): for num in list1: list2.append(num) list1.remove(num) list1 = [1,2,3,4,5] list2 = [10] move(list1, li...
sri321
187
views
asked
Aug 26
Programming in Python
python-programming
python
programming-in-python
list
functions
+
–
5
5 votes
1
1 answer
402
402 views
GO Classes DPP | GATE DA | Python Programming | Recursive Calls
Consider the following Python code:def virfib_sq(n): print(n) if n <= 1: return n return (virfib_sq(n - 1) + virfib_sq(n - 2)) 2 r4 = virfib_sq(4)What would be the outp...
GO Classes
402
views
asked
Jul 1
Programming in Python
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-213
programming-in-python
goclasses-python-&-dsa-practice-questions
output
recursion
numerical-answers
+
–
3
3 votes
1
1 answer
226
226 views
GO Classes DPP | GATE DA | Python Programming | Call Tree
Consider the following Python code:def virfib_sq(n): print(n) if n <= 1: return n return (virfib_sq(n - 1) + virfib_sq(n - 2)) 2 r3 = virfib_sq(3)What would Python disp...
GO Classes
226
views
asked
Jul 1
Programming in Python
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-213
programming-in-python
goclasses-python-&-dsa-practice-questions
output
recursion
+
–
2
2 votes
1
1 answer
196
196 views
GO Classes DPP | GATE DA | Python Programming | Tree Recursion
Consider the following Python code:def virfib_sq(n): print(n) if n <= 1: return n return (virfib_sq(n - 1) + virfib_sq(n - 2)) 2 r2 = virfib_sq(2)What would be the outp...
GO Classes
196
views
asked
Jul 1
Programming in Python
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-213
programming-in-python
goclasses-python-&-dsa-practice-questions
output
recursion
+
–
2
2 votes
1
1 answer
192
192 views
GO Classes DPP | GATE DA | Python Programming | Base Return
Consider the following Python code:def virfib_sq(n): print(n) if n <= 1: return n return (virfib_sq(n - 1) + virfib_sq(n - 2)) 2 r1 = virfib_sq(1)What would be the outp...
GO Classes
192
views
asked
Jul 1
Programming in Python
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-213
programming-in-python
goclasses-python-&-dsa-practice-questions
output
recursion
numerical-answers
+
–
1
1 vote
1
1 answer
215
215 views
GO Classes DPP | GATE DA | Python Programming | Base Case
Consider the following Python code:def virfib_sq(n): print(n) if n <= 1: return n return (virfib_sq(n - 1) + virfib_sq(n - 2)) 2 r0 = virfib_sq(0)What would be the outp...
GO Classes
215
views
asked
Jul 1
Programming in Python
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-213
programming-in-python
goclasses-python-&-dsa-practice-questions
output
recursion
numerical-answers
+
–
1
1 vote
1
1 answer
217
217 views
GO Classes DPP | GATE DA | Python Programming | Nested List
Consider the following Python code:def total_first(t): if not t: return 0 return t[0][0] + total_first(t[1:]) data = [[2, 7], [5, 1], [3, 8], [4, 9]] print(total_first(da...
GO Classes
217
views
asked
Jun 30
Programming in Python
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-212
programming-in-python
goclasses-python-&-dsa-practice-questions
output
recursion
numerical-answers
+
–
1
1 vote
1
1 answer
170
170 views
GO Classes DPP | GATE DA | Python Programming | Reverse Print
Consider the following Python code:def show(lst, i=0): if i == len(lst): return show(lst, i + 1) if lst[i] % 2 != 0: print(lst[i], end="") show([1, 2, 3, 4, 5])What is th...
GO Classes
170
views
asked
Jun 30
Programming in Python
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-212
programming-in-python
goclasses-python-&-dsa-practice-questions
output
recursion
+
–
1
1 vote
1
1 answer
158
158 views
GO Classes DPP | GATE DA | Python Programming | List Count
Consider the following Python code:def count_greater(lst, v): if not lst: return 0 count = 1 if lst[0] v else 0 return count + count_greater(lst[1:], v) print(count_grea...
GO Classes
158
views
asked
Jun 30
Programming in Python
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-212
programming-in-python
goclasses-python-&-dsa-practice-questions
output
recursion
numerical-answers
+
–
1
1 vote
1
1 answer
157
157 views
GO Classes DPP | GATE DA | Python Programming | Digit Recursion
Consider the following Python code:def mystery(n): if n < 10: return n a = n // 10 b = n % 10 return mystery(a + b) print(mystery(678))What is the output of the code abov...
GO Classes
157
views
asked
Jun 30
Programming in Python
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-212
programming-in-python
goclasses-python-&-dsa-practice-questions
output
recursion
numerical-answers
+
–
1
1 vote
1
1 answer
159
159 views
GO Classes DPP | GATE DA | Python Programming | Base Case
Consider the following Python code:def solve(n): if n <= 0: return 0 return n + solve(n - 2) print(solve(6), solve(5))What is the output of the code above?9 1212 912 12Re...
GO Classes
159
views
asked
Jun 30
Programming in Python
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-212
programming-in-python
goclasses-python-&-dsa-practice-questions
output
recursion
+
–
2
2 votes
1
1 answer
165
165 views
GO Classes DPP | GATE DA | Python Programming | Delete Nodes
Consider the following Python code:class Node: def __init__(self, data): self.data = data self.next = None a = Node("A") b = Node("B") c = Node("C") d = Node("D") a.next ...
GO Classes
165
views
asked
Jun 29
Programming in Python
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-211
programming-in-python
goclasses-python-&-dsa-practice-questions
output
linked-list
+
–
2
2 votes
1
1 answer
142
142 views
GO Classes DPP | GATE DA | Python Programming | Insert Nodes
Consider the following Python code:class Node: def __init__(self, data): self.data = data self.next = None head = Node(20) tail = head new_first = Node(10) new_first.next...
GO Classes
142
views
asked
Jun 29
Programming in Python
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-211
programming-in-python
goclasses-python-&-dsa-practice-questions
output
linked-list
+
–
2
2 votes
1
1 answer
129
129 views
GO Classes DPP | GATE DA | Python Programming | Traversal Length
Consider the following Python code:class Node: def __init__(self, data): self.data = data self.next = None n1 = Node(5) n2 = Node(10) n3 = Node(15) n4 = Node(20) n1.next ...
GO Classes
129
views
asked
Jun 29
Programming in Python
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-211
programming-in-python
goclasses-python-&-dsa-practice-questions
output
linked-list
+
–
2
2 votes
2
2 answers
189
189 views
GO Classes DPP | GATE DA | Python Programming | Node Linking
Consider the following Python code:class Node: def __init__(self, data): self.data = data self.next = None a = Node("A") b = Node("B") c = Node("C") a.next = b b.next = c...
GO Classes
189
views
asked
Jun 29
Programming in Python
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-211
programming-in-python
goclasses-python-&-dsa-practice-questions
output
linked-list
+
–
3
3 votes
2
2 answers
172
172 views
GO Classes DPP | GATE DA | Python Programming | Node Class
Consider the following Python code:class Node: def __init__(self, value): self.value = value self.next = None n1 = Node(10) n2 = Node(20) print(n1.value, n1.next, n2.valu...
GO Classes
172
views
asked
Jun 29
Programming in Python
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-211
programming-in-python
goclasses-python-&-dsa-practice-questions
output
linked-list
+
–
2
2 votes
1
1 answer
135
135 views
GO Classes DPP | GATE DA | Python Programming | Linked Node
Consider the following Python code:class Node: def __init__(self, data): self.data = data self.next = None n1 = Node(10) n2 = Node(20) n3 = Node(30) n1.next = n2 n2.next ...
GO Classes
135
views
asked
Jun 27
Programming in Python
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-210
programming-in-python
goclasses-python-&-dsa-practice-questions
output
+
–
1
1 vote
1
1 answer
121
121 views
GO Classes DPP | GATE DA | Python Programming | Attribute Update
Consider the following Python code:class Batch: def __init__(self, name, count): self.name = name self.count = count def shift(self, other, n): self.count = self.count - ...
GO Classes
121
views
asked
Jun 27
Programming in Python
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-210
programming-in-python
goclasses-python-&-dsa-practice-questions
output
+
–
2
2 votes
1
1 answer
122
122 views
GO Classes DPP | GATE DA | Python Programming | Self Keyword
Consider the following Python code:class Box: def __init__(self, value): self.value = value def add(self, value): self.value = self.value + value value = value + 100 retu...
GO Classes
122
views
asked
Jun 27
Programming in Python
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-210
programming-in-python
goclasses-python-&-dsa-practice-questions
output
+
–
2
2 votes
1
1 answer
117
117 views
GO Classes DPP | GATE DA | Python Programming | Object State
Consider the following Python code:class Account: def __init__(self, balance): self.balance = balance def deposit(self, amount): self.balance = self.balance + amount retu...
GO Classes
117
views
asked
Jun 27
Programming in Python
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-210
programming-in-python
goclasses-python-&-dsa-practice-questions
output
+
–
1
1 vote
1
1 answer
125
125 views
GO Classes DPP | GATE DA | Python Programming | Multiple Objects
Consider the following Python code:class Faculty: def __init__(self, name, subject): self.name = name self.subject = subject f1 = Faculty("Sachin", "Python") f2 = Faculty...
GO Classes
125
views
asked
Jun 27
Programming in Python
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-210
programming-in-python
goclasses-python-&-dsa-practice-questions
output
+
–
1
1 vote
1
1 answer
148
148 views
GO Classes DPP | GATE DA | Python Programming | Method Call
Consider the following Python code:class Batch: def __init__(self, students): self.students = students def add_students(self, n): self.students = self.students + n return...
GO Classes
148
views
asked
Jun 25
Programming in Python
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-209
programming-in-python
goclasses-python-&-dsa-practice-questions
output
+
–
2
2 votes
1
1 answer
128
128 views
GO Classes DPP | GATE DA | Python Programming | Attribute Access
Consider the following Python code:class Course: pass c = Course() c.name = "GATE DA" c.marks = 30 c.marks = c.marks + 5 print(c.name, c.marks)What is the output of the c...
GO Classes
128
views
asked
Jun 25
Programming in Python
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-209
programming-in-python
goclasses-python-&-dsa-practice-questions
output
+
–
2
2 votes
1
1 answer
117
117 views
GO Classes DPP | GATE DA | Python Programming | Object Creation
Consider the following Python code:class Counter: def __init__(self): self.value = 0 def increase(self): self.value = self.value + 1 c1 = Counter() c2 = Counter() c1.incr...
GO Classes
117
views
asked
Jun 25
Programming in Python
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-209
programming-in-python
goclasses-python-&-dsa-practice-questions
output
+
–
1
1 vote
1
1 answer
110
110 views
GO Classes DPP | GATE DA | Python Programming | Attributes Methods
Consider the following Python code:class Faculty: def teach(self): return self.subject + " class" f = Faculty() f.subject = "Python" print(f.subject) print(f.teach())What...
GO Classes
110
views
asked
Jun 25
Programming in Python
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-209
programming-in-python
goclasses-python-&-dsa-practice-questions
output
+
–
2
2 votes
1
1 answer
109
109 views
GO Classes DPP | GATE DA | Python Programming | Class Object
Consider the following Python code:class Student: pass s1 = Student() s2 = Student() s1.name = "Asha" s2.name = "Ravi" print(s1.name, s2.name, s1 is s2)What is the output...
GO Classes
109
views
asked
Jun 25
Programming in Python
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-209
programming-in-python
goclasses-python-&-dsa-practice-questions
output
+
–
2
2 votes
1
1 answer
151
151 views
GO Classes DPP | GATE DA | Python Programming | Set Operations
Consider the following Python code:A = {1, 2, 3, 4, 5} B = {4, 5, 6} C = {x * x for x in A if x % 2 == 1} print(sorted(A & B), sorted(A - B), sorted(C | {4}))What is the ...
GO Classes
151
views
asked
Jun 24
Programming in Python
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-208
programming-in-python
goclasses-python-&-dsa-practice-questions
output
+
–
1
1 vote
1
1 answer
105
105 views
GO Classes DPP | GATE DA | Python Programming | Add Remove
Consider the following Python code:fruits = {"apple", "banana"} fruits.add("apple") fruits.update(["cherry", "apple"], "go") fruits.discard("mango") fruits.remove("banana...
GO Classes
105
views
asked
Jun 24
Programming in C
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-208
programming-in-python
goclasses-python-&-dsa-practice-questions
output
+
–
Page:
1
2
3
4
5
6
next »