You must declare a variable before using it in a python program. True False Whic
ID: 3852120 • Letter: Y
Question
Explanation / Answer
1st is FALSE because there is no such thing as variable declaration or variable initialisation in python.
PYTHON is completely object oriented and not statically typed.you do not need to declare variable before using them or declare their type.Every variable in python is an object.In python variables don't have type, values do.
2nd is a memory block is assigned for a variable of mutable data type and immutable data type both the statments are correct for python. Now basically mutable means data that can be changed and immutable means data that can not be changed. Strings and numbers are immutable but that does not mean that they are constant but when we want to change the value of a string or number variable we have to replace the old value with a completely new value. List and arrays on the other hand are mutable, we can modify them after they have been created.
3rd. range(1,11,2) will create a list for numbers but with a step of 2. It means that it wil give a list with the numbers in arithmetic progression with a difference of 2 excluding the last number so our list will be [1,3,5,7,9]
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.