Raku kurss / Pamati / Nosacījumu pārbaudes / if
bloki
Tests: if
Complete the following programs.
1
This program has to check if the age is 21 years or more.
. | my $age = 24; | |
>= { | if $age ␣␣ 21 ␣ | Both >= and ≥ can be used here. |
. | say ‘We can sell it to you.’; | |
} | ␣ |
2
In this program, you have to check if $x
is between 10 and 15 (exclusive).
. | my $x = 12.3; |
< < | if 10 ␣ $x ␣ 15 { |
. | say ‘The value of $x is acceptable.’; |
. | } |
Kursa navigācija
←
Nosacījumu pārbaudes
|
Nosacījumu pārbaudes / else
bloki
→
💪 Or jump directly to the exercises to this section.
Šī lapa ir automātiski tulkota ar ChatGPT 4o. Oriģinālais teksts angļu valodā.
Šīs lapas tulkojumi: English • Deutsch • Español • Italiano • Latviešu • Nederlands • Български • Русский • Українська