A Level Computer Science paper 4 Solution | 9618/42/22 #MAK #CS

preview_player
Показать описание
#OL #OLevel #AL #ALevel #ComputerScience #MAK #CS #Learning #Teaching #Python #Coding #PsuedoCodes #BestResource

Рекомендации по теме
Комментарии
Автор

sir can you please send me some resources for the study preparation of computer science 9618 paper 4?

ezanime
Автор

sir can you guide about error
Enter a number11
Traceback (most recent call last):
File "C:\Users\HT\PycharmProjects\pythonProject4\main.py", line 17, in <module>
if Push(Numberx):
NameError: name 'Push' is not defined

Process finished with exit code 1
when code is seems right
def push(DataToPush):
global stackdata
global stackpointer
if stackpointer == 10:
return False
else:
stackdata[stackpointer] = DataToPush
stackpointer=stackpointer+1
return True

StackPointer = 0
StackData = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for x in range(0, 11):
Numberx = int(input("Enter a number"))
if Push(Numberx):
print("Stored")
else:
print("Stack full")
def printarray():
global stackdata
global stackpointer
print(stackpointer)
for x in range(0, 10):
print(stackdata[x])

PrintArray()

asrabibi