Learn Python pt.2— If .. Else Statement

Before, I told you about if statement. Now we next to If Else statement.

If so, If Else is branch logic is a very basic and important thing to master when you learn how to program language.

If Else

They commonly called this branching, because it has two or more branches. that is :

  1. branch If
  2. branch Else

look the example :

if we run the code, the output is :

Your point is 92
Congratulation! you pass

and, you can change point = 92 to input user like this :

point = int(input(" drop your point here : ")
...

Okay, let’s try if we use input user, look the example:

the output is :

50
sorry, you didn't pass

--

--

Melati Nur Malasari

Melati Nur Malasari |K3521042 |Pendidikan Teknik Informatika dan Komputer |2021 |Universitas Sebelas Maret |Melati.nur.malasari8@student.uns.ac.id|