• Register
1 vote
75 views

Problem:

I am a newbee in programmingand I am doing a online course on python. To follow that course I wrote a code:

def add(x , y):
  return x + y
def del(x, y):
  return x - y

choice = int(input("Please enter your Choice: "))
print 1.For addition 
print 2.For delete  

but it gives me some error like:

 File "calc.py", line 7
    print 1.For addition
          ^
SyntaxError: Missing parentheses in call to 'print'

What should I do now please help

10 7 2
6,060 points

Please log in or register to answer this question.

1 Answer

–1 vote

Answer:

In python proramming language if you type

print something

It will not work. If you want to print somthing you should write:

print("something")

So you should write your code like:

def add(x , y):
  return x + y
def del(x, y):
  return x - y

choice = int(input("Please enter your Choice: "))
print ("1.For addition")
print ("2.For delete") 

 Hope this may help you. Happy coding.

11 6 4
34,950 points

Related questions

0 votes
2 answers 589 views
589 views
Problem : When I try to use a print statement in Python, it gives me below error: SyntaxError: Missing parentheses in call to 'print'
asked Oct 22, 2019 peterlaw 6.9k points
0 votes
1 answer 3 views
3 views
Problem What can I do if parentheses is missing in call to 'print' in python ?
asked Apr 7 salim1 39k points
1 vote
1 answer 5 views
5 views
Problem: I need a help , How I can fix this : python missing parentheses in call to 'print'
asked Mar 19 MUHAMMAD MUNEEB 83k points
0 votes
1 answer 51 views
51 views
I am new to pyhton programming . I was doing some coding practice. I wrote a code: def addition(a , b): return a + b def delete(a, b): return a - b choice = int(input("Please enter your Choice: ")) print 1.For addition print 2.For delete but it gives me some error like: File "main.py", line 7 print 1.For addition ^ SyntaxError waht is the problem with my code can anyone help?
asked Mar 15, 2020 LizzyM 6.1k points
0 votes
1 answer 26 views
26 views
Task: Read an integer N . For all non-negative integers i<N , print i2. if __name__ == '__main__': n = int(input()) if (n<=0) and (n>=20): print("Exit") else: for(i=0,i<=n,i++): print(i*i) I am getting below error File "solution.py", line 6 for(i=0,i<=n,i++): ^ SyntaxError: invalid syntax Exit Status 255
asked Oct 25, 2020 psandprop 2.4k points
0 votes
1 answer 20 views
20 views
Problem: I am getting this error: Syntaxerror: can't assign to function call How do I fix this and make use of value of the function call?
asked Mar 22 ummesalma 27.2k points
0 votes
1 answer 64 views
64 views
Problem : How can I resolve this issue: Expression preceding parentheses of apparent call must have (pointer-to-) function type.
asked Mar 6 Wafa Abu Yousef 6.1k points
0 votes
1 answer 4.5K views
4.5K views
Problem : I am very new to C++ and trying to learning C++ template. Please find below my code, I am trying to define a template class and also want to call the member function in the main() method.. template <typename T> class Calculate { T _x; T ... the last line of above code : Expression preceding parentheses of apparent call must have (pointer-to-) function type How can I resolve this issue?
asked Dec 3, 2019 alecxe 7.5k points
0 votes
1 answer 4 views
4 views
Problem: I am writing a simple test using react-native-testing-library in my react native expo. I am getting this error when I run the test: Syntaxerror: missing initializer in const declaration
asked Mar 22 ummesalma 27.2k points