My Team (LOOP Community)
Sabtu, 25 April 2015
CODING PYTHON - Bilangan Faktorial
Coding Python - Bilangan Faktorial
class faktorial(object):
x = 0
y = 0
def _init_(self):
self.x=x
self.y =y
def faktor(self):
y=1
for x in range(1,self.y+1):
y = y*x
print x, "! = ",y
def main():
f= faktorial()
f.y = int(raw_input("Masukan Bilangan: "))
print "Program Bilangan Faktorial"
print "Author By : Frika Da Cintia"
print "Teknik Informatika"
print "============================"
print "Nilai Faktorial: "
f.faktor()
if __name__ == '__main__':
main()
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar