Telegram Group & Telegram Channel
🎲#گام_به_گام

💻 کدنویسی

0️⃣1️⃣ دستورات پایه در پایتون: قسمت دهم

🔣مختلط
اعداد مختلط با یک "j" به عنوان قسمت موهومی نوشته می شوند:
🟣 مثال
x = 3+5j
y = 5j
z = -5j

print(type(x))
print(type(y))
print(type(z))
خروجی پایتون:
<class 'complex'>
<class 'complex'>
<class 'complex'>
🔣 تبدیل نوع
می توانید با متدهای ()int()، float و ()complex یک نوع را به نوع دیگر تبدیل کنید:
🟣 مثال
x = 1 # int
y = 2.8 # float
z = 1j # complex

#convert from int to float:
a = float(x)

#convert from float to int:
b = int(y)

#convert from int to complex:
c = complex(x)

print(a)
print(b)
print(c)

print(type(a))
print(type(b))
print(type(c))
خروجی پایتون
1.0
2
(1+0j)
<class 'float'>
<class 'int'>
<class 'complex'>

❗️توجه: نمی توانید اعداد مختلط را به نوع اعداد دیگری تبدیل کنید.

🔣عدد تصادفی
پایتون یک تابع تصادفی () برای ساخت یک عدد تصادفی ندارد، اما پایتون یک ماژول داخلی به نام random دارد که می‌توان از آن برای ساخت اعداد استفاده کرد:

🟣 مثال
ماژول تصادفی را وارد کنید و یک عدد تصادفی بین 1 و 9 نمایش دهید:
import random

print(random.randrange(1, 10))
خروجی پایتون:
1

👈 ادامه دارد....

#️⃣#کدنویسی
#️⃣#IDSchools
#️⃣#IDS
#️⃣#IDS_Math

✉️@IDSchools
✉️@IDS_Math
Please open Telegram to view this post
VIEW IN TELEGRAM



group-telegram.com/IDS_Math/155
Create:
Last Update:

🎲#گام_به_گام

💻 کدنویسی

0️⃣1️⃣ دستورات پایه در پایتون: قسمت دهم

🔣مختلط
اعداد مختلط با یک "j" به عنوان قسمت موهومی نوشته می شوند:
🟣 مثال
x = 3+5j
y = 5j
z = -5j

print(type(x))
print(type(y))
print(type(z))
خروجی پایتون:
<class 'complex'>
<class 'complex'>
<class 'complex'>
🔣 تبدیل نوع
می توانید با متدهای ()int()، float و ()complex یک نوع را به نوع دیگر تبدیل کنید:
🟣 مثال
x = 1 # int
y = 2.8 # float
z = 1j # complex

#convert from int to float:
a = float(x)

#convert from float to int:
b = int(y)

#convert from int to complex:
c = complex(x)

print(a)
print(b)
print(c)

print(type(a))
print(type(b))
print(type(c))
خروجی پایتون
1.0
2
(1+0j)
<class 'float'>
<class 'int'>
<class 'complex'>

❗️توجه: نمی توانید اعداد مختلط را به نوع اعداد دیگری تبدیل کنید.

🔣عدد تصادفی
پایتون یک تابع تصادفی () برای ساخت یک عدد تصادفی ندارد، اما پایتون یک ماژول داخلی به نام random دارد که می‌توان از آن برای ساخت اعداد استفاده کرد:

🟣 مثال
ماژول تصادفی را وارد کنید و یک عدد تصادفی بین 1 و 9 نمایش دهید:
import random

print(random.randrange(1, 10))
خروجی پایتون:
1

👈 ادامه دارد....

#️⃣#کدنویسی
#️⃣#IDSchools
#️⃣#IDS
#️⃣#IDS_Math

✉️@IDSchools
✉️@IDS_Math

BY ریاضی، آمار و علوم کامپیوتر - مدارس میان‌رشته‌ای


Warning: Undefined variable $i in /var/www/group-telegram/post.php on line 260

Share with your friend now:
group-telegram.com/IDS_Math/155

View MORE
Open in Telegram


Telegram | DID YOU KNOW?

Date: |

"We're seeing really dramatic moves, and it's all really tied to Ukraine right now, and in a secondary way, in terms of interest rates," Octavio Marenzi, CEO of Opimas, told Yahoo Finance Live on Thursday. "This war in Ukraine is going to give the Fed the ammunition, the cover that it needs, to not raise interest rates too quickly. And I think Jay Powell is a very tepid sort of inflation fighter and he's not going to do as much as he needs to do to get that under control. And this seems like an excuse to kick the can further down the road still and not do too much too soon." Telegram has become more interventionist over time, and has steadily increased its efforts to shut down these accounts. But this has also meant that the company has also engaged with lawmakers more generally, although it maintains that it doesn’t do so willingly. For instance, in September 2021, Telegram reportedly blocked a chat bot in support of (Putin critic) Alexei Navalny during Russia’s most recent parliamentary elections. Pavel Durov was quoted at the time saying that the company was obliged to follow a “legitimate” law of the land. He added that as Apple and Google both follow the law, to violate it would give both platforms a reason to boot the messenger from its stores. Channels are not fully encrypted, end-to-end. All communications on a Telegram channel can be seen by anyone on the channel and are also visible to Telegram. Telegram may be asked by a government to hand over the communications from a channel. Telegram has a history of standing up to Russian government requests for data, but how comfortable you are relying on that history to predict future behavior is up to you. Because Telegram has this data, it may also be stolen by hackers or leaked by an internal employee. But the Ukraine Crisis Media Center's Tsekhanovska points out that communications are often down in zones most affected by the war, making this sort of cross-referencing a luxury many cannot afford. Some privacy experts say Telegram is not secure enough
from tw


Telegram ریاضی، آمار و علوم کامپیوتر - مدارس میان‌رشته‌ای
FROM American