0

Variables

Hello, I'm using Python, I'm learning to declare variables, but when I declare them, it seems It doesn't work, when I use print() it doesn't display the value of the variable, how do you declare a certain one?

31st Aug 2025, 11:06 PM
Pedro Cardoso Oliveira
Pedro Cardoso Oliveira - avatar
3 Antwoorden
+ 5
Hello Pedro Cardoso Oliveira. Welcome to the Sololearn community! In order for us to figure out what is not working correctly we need to see what code you have tried. Please post a copy of the code here; or better yet, post a link to it from your profile Code Bits (tap the circled + in the Comment reply box then find your code).
31st Aug 2025, 11:47 PM
Brian
Brian - avatar
+ 1
Pedro Cardoso Oliveira You must pass a variable to print() The print() will output a blank line For example : a=2 Print(a) Output: 2
1st Sep 2025, 8:50 AM
Mehdi Eslami
Mehdi Eslami - avatar
0
I can just guess that you are not aware of syntax to declare and print If it's that then I would recommend learning syntax It's like variable_name = value print(variable_name) Where you should follow the norms of writing variable_name and the value can be any form of python data type. So I recommend you to go through 'python for beginners' == If it's not the issue then please refer the code in the discussion as Sir Brian mentioned.
1st Sep 2025, 8:51 AM
Snehil Pandey
Snehil Pandey - avatar