Computer Science, asked by anitamalviya122, 11 months ago

What is the error in following python program with one
statement?
Print "My name is", name
Suggest a solution​

Answers

Answered by Anonymous
1

Brackets,single inverted commas:

print('my name is ')

thanks

mark brainliest

@ join the army of the shadows

Answered by Equestriadash
36

Print "My name is", name

There are 3 errors in the statement.

  • The use of uppercase 'p' instead of lowercase. [Syntax error]
  • The omission of brackets. [Syntax error]
  • The assignment of the variable 'name'. [Name error]

Solution:

>>> name = xyz

>>> print("My name is", name)

Output:

\tt My\ n ame\ is\ xyz

Syntax errors occur due to the violation of rules of the program whilst Name errors occur if no value has been assigned to 'name'.

Similar questions