Tutorial Python untuk bukan pengatur cara/Hello, World: Perbezaan antara semakan

tiada ringkasan suntingan
Tiada ringkasan suntingan
Tiada ringkasan suntingan
Alah bisa buat biasa.
-- Pepatah
 
<!--
'''School.py'''
 
<source lang="python">
# Contoh ini berlandaskan pengalaman penulis asal tutorial
# This is not quite true outside of USA
# and is based on my dim memories of my younger years
3 ** 2 = 9
 
=== ExercisesLatihan ===
 
# Write a program that prints your full name and your birthday as separate strings.
# Write a program that shows the use of all 6 math functions.
 
# Tulis program yang mencetak nam penuh anda serta hari jadi sebagai string berasingan.
# Tulis program yang menampilkan keenam-enam fungsi <tt>math</tt>.
 
{{Solution|title=SolutionJawapan|text=
 
1. Write aTulis program thatyang printsmencetak yournam fullpenuh nameanda andserta yourhari birthdayjadi assebagai separatestring stringsberasingan.
 
<source lang="python">
print "AdaSi LovelaceFulan", "bornlahir onpada", "November 27 November, 1852"
</source>
 
2. Write aTulis program thatyang showsmenampilkan thekeenam-enam use of all 6fungsi <tt>math operations</tt>.
 
<source lang="python">
#Apa-apa yang hampir dengan berikut dapt diterima:
#Anything along these lines is acceptable:
 
#Penambahan
#Addition
print "2 + 5 = ", 2 + 5
 
#penolakan
#subtraction
print "9 - 3 = ", 9 - 3
 
#darab
#multiplication
print "3 * 3 = ", 3 * 3
 
#bahagi
#division
print "90 / 5 = ", 90 / 5
 
#eksponen
#exponents
print "7 topada the power ofkuasa 2 (squaredkuasa dua) = ", 7 ** 2
 
#baki
#remainder
print "the remainder when doingbaki 22 / 9 = ", 22 % 9
</source>
}}
----
 
-->
==== Nota kaki ====
<references/>
1,163

suntingan