PYTHONCHALLENGE Telegram 1617
#مقدماتی_پایتون

✍️تبدیل نوع (type conversion)


📌در Python شما نمی توانید دورشته را که شامل اعداد 2 و 3 است، برای تولید عدد صحیح 5، به یکدیگر اضافه کنید.
ما برای اینکه بخواهیم عدد 5 را تولید کنیم باید آنها را تبدیل کنیم.
که در اینجا با استفاده از تابع int این کار را انجام می دهیم.

>>>"2"+"3"
'23'
>>> int("2")+int("3")
5
>>>float(input("Enter a number:")) + float(input("Enter another number :"))
Enter a number : Enter another number : 42.0



مثال هایی از تبدیل نوع

⚠️⚠️
>>>print ("23"+"27")
'2327'
>>>float('0.3') +int('2')
2.3
>>>print(int("23")+int("27"))
50


بعد مطالعه متن فوق به سوال زیر لطفا پاسخ بدهید:

🗂 مرکز آموزش پایتون

🆔 : @pythonchallenge



tgoop.com/pythonchallenge/1617
Create:
Last Update:

#مقدماتی_پایتون

✍️تبدیل نوع (type conversion)


📌در Python شما نمی توانید دورشته را که شامل اعداد 2 و 3 است، برای تولید عدد صحیح 5، به یکدیگر اضافه کنید.
ما برای اینکه بخواهیم عدد 5 را تولید کنیم باید آنها را تبدیل کنیم.
که در اینجا با استفاده از تابع int این کار را انجام می دهیم.

>>>"2"+"3"
'23'
>>> int("2")+int("3")
5
>>>float(input("Enter a number:")) + float(input("Enter another number :"))
Enter a number : Enter another number : 42.0



مثال هایی از تبدیل نوع

⚠️⚠️
>>>print ("23"+"27")
'2327'
>>>float('0.3') +int('2')
2.3
>>>print(int("23")+int("27"))
50


بعد مطالعه متن فوق به سوال زیر لطفا پاسخ بدهید:

🗂 مرکز آموزش پایتون

🆔 : @pythonchallenge

BY چالش پایتون


Share with your friend now:
tgoop.com/pythonchallenge/1617

View MORE
Open in Telegram


Telegram News

Date: |

Deputy District Judge Peter Hui sentenced computer technician Ng Man-ho on Thursday, a month after the 27-year-old, who ran a Telegram group called SUCK Channel, was found guilty of seven charges of conspiring to incite others to commit illegal acts during the 2019 extradition bill protests and subsequent months. Matt Hussey, editorial director of NEAR Protocol (and former editor-in-chief of Decrypt) responded to the news of the Telegram group with “#meIRL.” To delete a channel with over 1,000 subscribers, you need to contact user support 2How to set up a Telegram channel? (A step-by-step tutorial) The public channel had more than 109,000 subscribers, Judge Hui said. Ng had the power to remove or amend the messages in the channel, but he “allowed them to exist.”
from us


Telegram چالش پایتون
FROM American