local variable, global variable in python

@amitmund June 03, 2026
x = "Hello"

def myfunc():
  print("Python is " + x)

myfunc()
x = "Hello"

def myfunc():
  x = "CTTC"
  print("Python is " + x)

myfunc()

print("Python is " + x)

0 Likes
36 Views
0 Comments

Filters

No filters available for this view.

Reset All