Tweet ghim
Prince
1.4K posts

Prince
@prince_cpp
19 I CS'29 lazy with ambitions
Tham gia Mart 2026
366 Đang theo dõi75 Người theo dõi

@vedantReddy45 @itslaraib786 inko to call bhi aa rha tha , kuch suggestion lelo
English

@vedantReddy45 bhai finance aisa karegi na tera
ki tu seedhe swarg chala jayega
हिन्दी

@BhargavLearns mera matlab maine college ke start me try kiya tha ab soch rha hu wo kya tha , earthworm tha wo
python to tum padh rhe ho
Eesti

Recently, while learning Python, I discovered some subtle points that have changed the way I view Python:
1) Reference: Unlike other programming languages, Python variables are not containers that hold a value. Instead, Python variables are pointers that refer to an object.
A mind-blowing example to understand why this matters:
a = [1,2,3]
b = a
a.append (4) #This returns None btw
print(a,b)
Many people might think that after this, a = [1, 2, 3, 4] while b remains [1,2,3], but that's exactly why we should learn more about references.
In reality, both variables point to the same object in memory; thus, both will be the same list object with the same elements.
2) Mutability & Immutability: In Python, mutability and immutability are crucial concepts. While references are a big part of this discussion, using the same example for strings helps to clarify this concept even better.
a = "1, 2, 3"
b = a
b= b. replace ("1", "2")
print(a,b)
The result here will differ!
While a will remain "1,2,3 ", but b will become "2, 2, 3" because "strings are immutable!"
This is significant because any operation on an immutable object creates a new object. Therefore, when a method is performed on b, b will refer to a new object.
3) list methods: Do you know that some list methods return new objects?
If you want a new list, you can concatenate lists or copy a list using the. copy () method. These techniques help create new lists, which can be very useful.
4) Python & its objects: Everything in Python is an object. From functions to modules to generators, everything is an object. This means their names should follow the same rules as variable names, and you can pass them into other functions or your main function as needed.
5) Scopes: When you assign a variable in Python and print that variable, Python does something very interesting.
Example:
x = 10 #global
def name():
x = 12 #enclosing
def name _ 2 ():
x = 13 #local
name_2()
name()
Here, Python first checks for a local variable (inside the inner function), then for an enclosing variable (inside the outer function), then for a global variable (outside the functions), and finally for built- in variables.
Now, Python will surprise you with a tricky moment!
If you write:
x = 12
def n():
Print (x)
x = 10
It will return an error!
Because Python checks for local variables first, it is printing x before assigning a value to X.
I hope reading this tweet would give you some aha moments!!!
English

@athrix_codes bhai landing me bahut prblm hoti hai har baar crash ho jata hai
हिन्दी

Well, people on Twitter have always supported me and celebrated every milestone with me.
Not a very big gesture, but if you're not verified, drop a comment below.
Ojas Sharma@OjasSharma276
22 and I already feel old 🥀
English

@mihir_twt japanese and chinese are very tough , spanish won't give you any edge
English

and i also need to pick a language from
> Chinese
> French
> German
> Japanese
> Spanish
im leaning towards german or chinese/japanese
mihir@mihir_twt
writing 2 different posts so i can get better advice. i have to select one open elective course this year in additon to mandatory core courses. > Computer-Aided 3d Geometric Modeling > Device Materials > Electrical Installation & Practices > Geo-Informatics > International Standards > Microcontrollers and Interfacing > Production Process & Metrology > Sensors and Actuators > Numerical Methods i want a general idea about these courses before i make a selection, not looking to just score for cgpa
English
Prince đã retweet





















