A difference between Java and Python is: Python data-types are generally associa
ID: 3824436 • Letter: A
Question
A difference between Java and Python is: Python data-types are generally associated with the values of identifiers, whereas Java data-types are associated with the identifiers themselves.
True
False
In the following code fragment, calling fun(999) with change the value of xyz from 123 to 999
xyz = 123;
def fun(xyz):
xyz = xyz * xyz
return xyz
True
False
In Python, after a list is created, the values within the list may be freely altered elsewhere in the program.
True
False
A call to a function in Python may return multiple values of multiple types by returning a "tuple".
True
False
Explanation / Answer
TRUE
Python data-types are generally associated with the values of identifiers whereas Java data-types are associated with the identifiers themselves
In Python there is no need to declare variable datatype before using it. In Python, we just simply assign the value to a variable,python internally does the data type assignment according to the type of data we provide
But in case of we have to provide the data type ov variable while declaring it.
FALSE ,The value of xyz will remain the same because return statement will put the value from where it is called and moreover xyz in function is a local variable.
True ,after a list is created the values within the list may be freely altered ,here are some functions to alter the list
insert(): adds a new entry at the index specified in the list
append():It adds a new entry to the last of the list.
clear(): removes all values from the list.
.remove(): Removes entry from the specified position in the list.
TRUE
call to a function in Python may return multiple values of multiple types by returning a "tuple".
I will show a example.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.