Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Can variables in python be used to print a letter instead of a number?

+5 votes
asked Jun 9, 2023 by morchalay (170 points)

2 Answers

0 votes
answered Jun 14, 2023 by Peter Minarik (86,240 points)

Sure you can:

name = "Charles"
salary = 120000

print(f"{name} earns ${salary} a year.")
0 votes
answered Jun 16, 2023 by Eidnoxon (5,140 points)

I guess you mean this:
 

x = "Hello world"

print(x)

The output would be:
Hello world
and the answer to your question is yes, by using the `String` datatype, you can store a string value in a variable, and print it out as a text.

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...