Created
June 3, 2022 16:07
-
-
Save Wulgaren/ff779e6820e0168276f66be5671512f4 to your computer and use it in GitHub Desktop.
Hello World Examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HelloWorld: | |
def __init__(self, name): | |
self.name = name.capitalize() | |
def sayHi(self): | |
print "Hello " + self.name + "!" | |
hello = HelloWorld("world") | |
hello.sayHi() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HelloWorld | |
def initialize(name) | |
@name = name.capitalize | |
end | |
def sayHi | |
puts "Hello !" | |
end | |
end | |
hello = HelloWorld.new("World") | |
hello.sayHi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Run `python hello_world.py` to print Hello World |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Run `ruby hello_world.rb` to print Hello World |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment