🪟 Windows TippsThe Gemini desktop app is now available for Windows(11.09.2026 um 17:06 Uhr)
⚠️ Malware / Trojaner / VirenWindows 11 just dropped the tool ransomware abused, Microsoft says don’t restore WMIC(10.09.2026 um 20:11 Uhr)
⚠️ Malware / Trojaner / VirenVorsicht: Android-Malware verschlüsselt Ihre Handys und nimmt heimlich Fotos auf(11.09.2026 um 09:35 Uhr)
🕵️ SicherheitslückenMicrosoft geht endlich eines der nervigsten Probleme von Windows 11 an(11.09.2026 um 11:58 Uhr)
💾 IT Security ToolsSysinternals Suite(11.09.2026 um 12:00 Uhr)
🕵️ SicherheitslückenDefender 0-Day ShieldBreak (CVE-2026-69414) nicht sauber gepatcht - BornCity(11.09.2026 um 12:52 Uhr)
🪟 Windows TippsThe Gemini desktop app is now available for Windows(11.09.2026 um 17:06 Uhr)
⚠️ Malware / Trojaner / VirenWindows 11 just dropped the tool ransomware abused, Microsoft says don’t restore WMIC(10.09.2026 um 20:11 Uhr)
⚠️ Malware / Trojaner / VirenVorsicht: Android-Malware verschlüsselt Ihre Handys und nimmt heimlich Fotos auf(11.09.2026 um 09:35 Uhr)
🕵️ SicherheitslückenMicrosoft geht endlich eines der nervigsten Probleme von Windows 11 an(11.09.2026 um 11:58 Uhr)
💾 IT Security ToolsSysinternals Suite(11.09.2026 um 12:00 Uhr)
🕵️ SicherheitslückenDefender 0-Day ShieldBreak (CVE-2026-69414) nicht sauber gepatcht - BornCity(11.09.2026 um 12:52 Uhr)

🔧 Programmierung 🕛 vor 1 Jahr 2 Min Lesezeit
0

Python: Variables

↗ Quelle (dev.to)
🗣️ Stimme:

Hi All,

Today we are going to learn python variables.






VARIABLES




  1. Commonly variables are keep some value like str, int etc.

  2. Python didn't use any command for declare variable, when the value 3. assigned first that moment variables are created and case sensitive.

  3. Variables don't need to be declared with any particular type and can even change the type after they set.




CODE
a=1         # variable as int
b="aravin" # variable as string
x=5 # First assign the int value to X
x='aravin' # Later assign the str value to X
print(x) # o/p aravin, recently assign value to use same variable.









Case Sensitive





CODE
a=100
A='India' # a will not overwrite to A both are diff.
print(a)
print(A)









To get Variable type





CODE
var=100
mvar='Hello'
print(type(var))









Rule for Create Variable



  1. Variable name should be start with char or underscore char.

  2. Should not be start with numbers.

  3. Should not be any of python key word.



Ex:

Proper Name:

my_variable_name = "Aravin" #snake type

myVariableName = "Aravin" #Camel type

MyVariableName = "Aravin" #Pascal type

myvarname = "Aravin"

_myvarname = "Aravin"

myvar_name = "Aravin"

myvar21 = "Aravin"



Improper Name:

2myVar = "Hello"

my-var = "Hello"

my var = "Hello"






To assign multiple values to multiple variable





CODE
a,b,c = 5,"aravin","DB"









One value to multiple variable





CODE
a = b = c = "Apple"









To unpack a collection





CODE
myVar = ["var1","var2","var3"]
a,b,c = myVar
print(myVar)
print(b)









Global Variable



  1. To be created outside the function called global variable Or created with global keyword.

  2. Global variable can be used by everyone both inside and outside function



Ex:






Created outside the function





CODE
a = "python"
def myfunc():
print("Hello " + a)
myfunc()









Variable created inside the function, with same name of global





CODE
a = "python"
def myfunc():
a = "python"
print("Hai " + a)
myfunc()
print("Hello " + a)









Create global variable by use global keyword inside the function





CODE
def myfunc():
global a
a = "python"
myfunc()
print("Hello " + a)









Change global variable value inside the function





CODE
a = "python"
def myfunc():
global a
a = "Python"
myfunc()
print("Hai " + x)


Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
2 Quellen
Microsoft admits Windows 11’s biggest September update is breaking multiple features, days after it warned users not to delay updates
1 Quelle
The Gemini desktop app is now available for Windows
1 Quelle
Windows 11 just dropped the tool ransomware abused, Microsoft says don’t restore WMIC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Python: Variables

Thematisch verwandte Begriffe: Python, Variables · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...