• Register
0 votes
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?

10 7 2
6,060 points

Please log in or register to answer this question.

1 Answer

–1 vote

In python if you use

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 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") 

 

11 6 4
34,950 points

Related questions

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
2 answers 588 views
588 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
1 vote
1 answer 75 views
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 ... 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
asked Apr 4, 2020 LizzyM 6.1k points
0 votes
1 answer 60 views
60 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 1 view
1 view
Problem: Print new output on same line.I want to print the looped output to the screen on the same line.How do I do this in the simplest way for Python 3?
asked 1 day ago sumaiya simi 16.2k points
0 votes
1 answer 3 views
3 views
Problem: I want to print in a new line in python, help me to do it.
asked 5 days ago zayed1 35.6k points
0 votes
1 answer 2 views
2 views
Problem: Can someone please help with this, I am new in python(How to print duplicate characters from string in python?)
asked Mar 31 zayed1 35.6k points