Konversi kode python menjadi pseudocode online
def is_balanced(line):
'''Determine if all parentheses in an entered line of code form matching pairs.
Note: Pairs of parentheses may be nested.'''
stack = []
for char in line:
if char == '(':
stack.append(char)
elif char == ')':
if len(stack) == 0:
return False
stack.pop()
return len(stack) == 0
Mokshagna samineni 21BAI10363