If-else practice
Conditional statements will come up in your code in lots of places, so its really important you are comfortable with them.
In the following samples you are writing little pieces of code to:
- Find the absolute value of a number
- Find the maximum value of two numbers
- Print a message if your script has finished
The variables you need to complete these examples, x, y, and finished are available in your environment.
이 연습은 강의의 일부입니다
Introduction to Julia
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
# Print x if it is positive, otherwise print -x
____
println(x)
____
println(-x)
____