Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions hello_world/facts.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Bananas are berries, but strawberries aren't.
Honey never spoils. Archaeologists have found pots of honey in ancient Egyptian tombs that are over 3000 years old and still perfectly edible.
A day on Venus is longer than a year on Venus.
14 changes: 14 additions & 0 deletions hello_world/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import random

def read_facts(file_path):
with open(file_path, 'r') as file:
facts = file.readlines()
return [fact.strip() for fact in facts]

def main():
facts = read_facts('facts.txt')
interesting_fact = random.choice(facts)
print("Hello, World! Did you know? " + interesting_fact)

if __name__ == '__main__':
main()