Question PRG-PY-0008
EasyWhat is the output of this program?
name = "Asha"
print(f"Hello, {name}!")
- A.
Error
- B.
Hello, {name}!
- C.
Show answer and explanation
Answer: C
An f-string substitutes the value of name into the braces.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Python question
What is the output of this program?
name = "Asha"
print(f"Hello, {name}!")
Error
Hello, {name}!
Answer: C
An f-string substitutes the value of name into the braces.
Hello, Asha!
Hello, name!