embedded system,Arduino,Raspberry pi,ARM7,MM32,STM32,PIC and Python,Django,Datascience and web development
Thursday, August 29, 2019
del keyword usage in python
"""
Created on Thu Aug 29 16:29:56 2019
@author: anil durgam
date:29-08-2019
"""
f = 11;
print(f)
del f
print(f)
output:
del f
^
IndentationError: unexpected indent
Created on Thu Aug 29 16:29:56 2019
@author: anil durgam
date:29-08-2019
"""
f = 11;
print(f)
del f
print(f)
output:
del f
^
IndentationError: unexpected indent
global key word usage in python
"""
Created on Thu Aug 29 16:29:56 2019
@author: anil durgam
date:29-08-2019
"""
f = 101;
print(f)
# Global vs.local variables in functions
def someFunction():
global f
print(f)
f = "changing global variable"
someFunction()
print(f)
output:
101
101
changing global variable
Created on Thu Aug 29 16:29:56 2019
@author: anil durgam
date:29-08-2019
"""
f = 101;
print(f)
# Global vs.local variables in functions
def someFunction():
global f
print(f)
f = "changing global variable"
someFunction()
print(f)
output:
101
101
changing global variable
declaration and re-declaration of the variable
"""
Created on Thu Aug 29 16:29:56 2019
@author: anil durgam
date:29-08-2019
"""
# Declare a variable and initialize it
f = 0
print(f)
# re-declaring the variable works
f = 'guru99'
print(f)
output:
0
guru99
example 3:
"""
Created on Thu Aug 29 16:29:56 2019
@author: anil durgam
date:29-08-2019
"""
# Declare a variable and initialize it
f = 101
print(f)
# Global vs. local variables in functions
def someFunction():
# global f
f = 'I am learning Python'
print(f)
someFunction()
print(f)
output:
101
I am learning Python
101
defination in python
"""
Created on Thu Aug 29 16:29:56 2019
@author: anil durgam
date:29-08-2019
"""
def main():
print("hello world\n");
if __name__ =="__main__":
main()
print("testing")
Created on Thu Aug 29 16:29:56 2019
@author: anil durgam
date:29-08-2019
"""
def main():
print("hello world\n");
if __name__ =="__main__":
main()
print("testing")
Subscribe to:
Posts (Atom)
-
How to do the programming python in windows command prompt Step 1: please go through below link website f...
-
Serial.print() Description Prints data to the serial port as human-readable ASCII text. This command can take many forms. Numbers a...