no way to compare when less than two revisions

تفاوت‌ها

تفاوت دو نسخهٔ متفاوت از صفحه را مشاهده می‌کنید.


courseware:python_programming:resources:answer:21 [2022/07/19 17:51] (فعلی) – ایجاد شد - ویرایش خارجی 127.0.0.1
خط 1: خط 1:
 +==== پاسخ پرسش صد سالگی ====
  
 +با استفاده از String Concatenation:
 +
 +<code python line-numbers="true">
 +name, age = input(), input()
 +year = 1400 - int(age) + 100
 +print(name + " will be 100 years old in the year " + str(year) + ".")
 +
 +</code>
 +
 +با استفاده از String Formatting:
 +
 +<code python line-numbers="true">
 +name, age = input(), input()
 +year = 1400 - int(age) + 100
 +print("{} will be 100 years old in the year {}.".format(name, year))
 +
 +</code>