Foto User
FACTORIZATION USING PYTHON

Eka Wulan Yunita

Sosial Media


4 orang menyukai ini
Suka

Summary

Python is the most popular programming language because of its easy use and open source. Currently, Python can also be used in Google Colab, making it easier for many people to use. It's simple learning from python in google colaboratory with ‘FACTORIALS and FACTOR OF A NUMBERS’

Description

What is factorials?

A factorial is a positive number that is multiplied by itself until it runs out (up to 1). which is denoted by n!

Example : 

The factorial of 6 is ?

6 ! = 6 x 5 x 4 x 3 x 2 x 1 = 720

 

*factorial source code using python

                      Steps by step :

                      1. Displays the instruction word with print command (*print is used to print a command, and "" is used to print a word).

                      2. Displays prompts for inputting numbers with input command.

                      3. Create recursive functions with the factorial variable whose value will be multiplied by (i) variable.

                      4. Accommodate factorial outcome variables.

                      5. Create a "print" format to display the results.

Results

 

 

What is Factor of a Numbers?

The factor of a number is a number that divides evenly into the number.

Example : 

The factor of 24 is ?

 The factors of 24 = 1, 2, 3, 4, 6, 8, 12, and 24

( Because, the product of 24 are 1 x 24, 2 x 12, 3 x 8, and 4 x 6. )

 

*Source code from Factor of a number using python

 

Step by step :

1. Displays the instruction word ‘menentukan faktor bilangan’ with print command (*print is used to print a command, and "" is used to print a word).

2. Create a looping function starting from number 1 to equal to n. Then, Make a check if n is divisible by numbers 1 to equal to n, if the check is true, the value will contain a number.

2. Displays prompts for inputting numbers with input command.

4. Accommodate outcome variables.

5. Create a "print" format to display the results.

 

Results

Informasi Course Terkait
  Kategori: Natural Language Processing
  Course: Dasar - Dasar Python