No products in the cart.

Identify the error in this python …

CBSE, JEE, NEET, CUET

CBSE, JEE, NEET, CUET

Question Bank, Mock Tests, Exam Papers

NCERT Solutions, Sample Papers, Notes, Videos

<font face ="Times New Roman">Identify the error in this python program: (as per cbse term 2 qp)</font>

<font face ="Courier New"> Only3_5=[]
def Push3_5(N):
⠀⠀for i in N:
⠀⠀⠀⠀if i %3==0 or i%5==0:
⠀⠀⠀⠀⠀⠀Only3_5.append(i)

</font> <font face ="Times New Roman">Bet most of the students done this but it has error whatsoever.
  • 5 answers

Royal Thakur 2 years, 5 months ago

I THINK CS WAS EASIER IN TERM 1 IN CAMPARISION TO TERM 2
WHAT DO YOU THINK ?

Aseem Mahajan 2 years, 5 months ago

<font face ="Times New Roman">Same as yours, 91

Royal Thakur 2 years, 5 months ago

What was the code of your cs qp ?

Aseem Mahajan 2 years, 5 months ago

<font face ="Times New Roman">There is error. You have declared a global variable Only3_5. To use in function block, you have to use global keyword. And hence you have to add the statement 'global Only3_5' as the first line of function defining block.

Royal Thakur 2 years, 5 months ago

I think there is no error
http://mycbseguide.com/examin8/

Related Questions

What is mean by buffering in file handling?
  • 1 answers
What are called tokens
  • 2 answers

myCBSEguide App

myCBSEguide

Trusted by 1 Crore+ Students

Test Generator

Test Generator

Create papers online. It's FREE.

CUET Mock Tests

CUET Mock Tests

75,000+ questions to practice only on myCBSEguide app

Download myCBSEguide App