IT Questions and Answers :)

Monday, January 11, 2021

When programming in Python 3, which code has the right syntax?

When programming in Python 3, which code has the right syntax?

  • print("Hello, World")
  • print("Hello, World')
  • print("Hello, World"
  • print (Hello, World) 
 

EXPLANATION

Syntax errors are a the most common problem when programming.  For basic programming, an open bracket is required for any parameters to be passed to a function, and strings (text) requires quotes to distinguish itself from any variables in the code.  

SOURCE

https://medium.com/groklearning/syntax-error-how-to-avoid-the-most-common-trap-for-new-programmers-1424472c3e57
Share:

0 comments:

Post a Comment

Popular Posts