Question

What kind of statement creates a variable in Python (i.e., what do you need to do...

What kind of statement creates a

variable in Python (i.e., what do you need to do to make a new variable exist in your code)?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Thanks for the question.

=========================================================

In Python language,

When you assign a value to a variable, its data type automatically gets created.

Before creating a variable, you have to find a meaningful name of the variable and then assign an appropriate value to the variable.

For example to create an int variable which store score, you can use the below statement

score = 0

this will create a new variable by the name score and it will be of int type as we assign an integer to the variable

pi = 3.14159 # this will create a float variable

flag = True # this will create a boolean variable

=========================================================

I hope it answered your query.

Add a comment
Know the answer?
Add Answer to:
What kind of statement creates a variable in Python (i.e., what do you need to do...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT