LearnFrenzy
Sign in Take a free test

Variables and Data Types · Find the Error · Question 4

Error: a space in a variable name Answer, explanation & discussion

  • Find the error
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
Question 4 Back to Exercise

Python refuses to run the program below. Which statement correctly describes the problem?

main.py
first name = "Kavya"
print(first name)
  • A The string needs single quotes
  • B print needs an f-string
  • C Names must start with a capital letter
  • D A variable name cannot contain a space; use first_name Correct
Correct Answer: Option D

Identifiers are letters, digits and underscores only. PEP 8 style is first_name.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links