Telegram Group & Telegram Channel
#تمرین_شئ_گرایی
تمرین چهارم

1. یک کلاس بسازید به اسم Vector
که 3تا آرگیومنت x, y ,z داشته باشه
بدون مقدار Default

2. تابع repr باید به طوری نوشته بشه که یوزر بتونه ازش برای باز سازی آبجکت استفاده کنه
( Reconstruct the instance )

3. باید اندازه بردار رو حساب کنیم
برای محاسبه بردار نیازه که شما جذر جمع توان 2 هر نقطه رو حساب کنید
from math import sqrt
sqrt( x **2 + y **2 + z **2 )
وقتی از تابع abs روی آبجکت استفاده میکنیم اندازه بردار رو برگردونه
 __abs__ 

4. امکان جمع دو Vector باهم داشته باشه
امکان ضرب یک عدد int و float با vector داشته باشه


5. تمامی عملگر های منطقی رو ساپورت کنه
بر اساس
 abs(Vector)

6. قابلیت hash شدن رو داشته باشه

7. در تابع bool وقتی اندازه بردار 0 بود False برگردونه


8. و در آخر کلاس باید این اجازه رو به کاربر بده تا از طریق براکت بتونه نقاط رو بدست بیاره
v['y']
v['Y']
بزرگ و کوچک هر2 رو باید ساپورت کنه...


جواب این سوال در گیت هاب قرار گرفته است
https://github.com/persianpython/PythonObjectOriented



tg-me.com/persianpython_official/139
Create:
Last Update:

#تمرین_شئ_گرایی
تمرین چهارم

1. یک کلاس بسازید به اسم Vector
که 3تا آرگیومنت x, y ,z داشته باشه
بدون مقدار Default

2. تابع repr باید به طوری نوشته بشه که یوزر بتونه ازش برای باز سازی آبجکت استفاده کنه
( Reconstruct the instance )

3. باید اندازه بردار رو حساب کنیم
برای محاسبه بردار نیازه که شما جذر جمع توان 2 هر نقطه رو حساب کنید

from math import sqrt
sqrt( x **2 + y **2 + z **2 )
وقتی از تابع abs روی آبجکت استفاده میکنیم اندازه بردار رو برگردونه
 __abs__ 

4. امکان جمع دو Vector باهم داشته باشه
امکان ضرب یک عدد int و float با vector داشته باشه


5. تمامی عملگر های منطقی رو ساپورت کنه
بر اساس
 abs(Vector)

6. قابلیت hash شدن رو داشته باشه

7. در تابع bool وقتی اندازه بردار 0 بود False برگردونه


8. و در آخر کلاس باید این اجازه رو به کاربر بده تا از طریق براکت بتونه نقاط رو بدست بیاره
v['y']
v['Y']
بزرگ و کوچک هر2 رو باید ساپورت کنه...


جواب این سوال در گیت هاب قرار گرفته است
https://github.com/persianpython/PythonObjectOriented

BY Persian python




Share with your friend now:
tg-me.com/persianpython_official/139

View MORE
Open in Telegram


Persian python Telegram | DID YOU KNOW?

Date: |

How To Find Channels On Telegram?

There are multiple ways you can search for Telegram channels. One of the methods is really logical and you should all know it by now. We’re talking about using Telegram’s native search option. Make sure to download Telegram from the official website or update it to the latest version, using this link. Once you’ve installed Telegram, you can simply open the app and use the search bar. Tap on the magnifier icon and search for a channel that might interest you (e.g. Marvel comics). Even though this is the easiest method for searching Telegram channels, it isn’t the best one. This method is limited because it shows you only a couple of results per search.

What is Telegram?

Telegram’s stand out feature is its encryption scheme that keeps messages and media secure in transit. The scheme is known as MTProto and is based on 256-bit AES encryption, RSA encryption, and Diffie-Hellman key exchange. The result of this complicated and technical-sounding jargon? A messaging service that claims to keep your data safe.Why do we say claims? When dealing with security, you always want to leave room for scrutiny, and a few cryptography experts have criticized the system. Overall, any level of encryption is better than none, but a level of discretion should always be observed with any online connected system, even Telegram.

Persian python from us


Telegram Persian python
FROM USA