// This file shows the use of ifdev conditional directive in AsciiDoc

= Programming Fundamentals 
:Author: Prof. Chinmaya S Rathore
:langruby:  
:rubyskill-starter: 


== Functions
Let's try to learn why functions are important in computer programming and how to write functions. 

[%hardbreaks]
ifdef::langpy[]  
Functions permit us to reuse code and prevent errors. The following example show how we can write a function in Python to convert temperature in Celsius to Fahrenheit. 

 def celsius_to_fahrenheit(celsius):
    return (celsius * 9 / 5) + 32

endif::[]      

//We add an ifndef conditional directive below to add python code if :codelangruby: attribute is missing or unset


[%hardbreaks]
ifdef::langruby[]
Functions permit us to reuse code and prevent errors. The following example show how we can write a function in Python to convert temperature in Celsius to Fahrenheit. 
 def celsius_to_fahrenheit(celsius)  
    (celsius * 9 / 5) + 32        
  end
endif::[]

