Skip to main content
hero
Web Magazine
Braschi-Quarenghi

Benedictine and Franciscan Monks: Forgotten Inventors

   Usually, when we think of religious orders, these things come to mind: a cloister, an abbey, a library, prayer in solitude, detachment from the world… All this in the cradle of a period defined as "dark" by historiography up to Romanticism: the Middle Ages . In this period the monks - especially the Benedictines of the various orders - were the custodians of Judeo-Christian but also classical culture, since thanks to their patient and meticulous transcriptions as scribes we have received almost all of the Greek and Latin works which we study today. Today we are grateful to them first of all for this.   However, many do not know that many products - material and immaterial - that we consume and use every day, come from monks who, using their ingenuity nourished by a profound spirituality, invented them due to practical necessities.    Personally, I find it amazing!    Let's begin…   The heavy plow   Plows were a primary agri...

Python explained with Math - Part 2

 


Introduction

If you’re new here, this is the second part of an article where I show the basics of programming languages with Python, one of the most famous and beginner-friendly one. You can find the first part of the article here.

 If you, instead, have already read the first part of this article, you’ll probably remember I left you with a problem to solve using Python, without giving you the final solution… so, here it is!

 Solution (problem of part 1 of the article)

Presented problem:

 “Let a to be 2 and b to be 3. Given y = 5a + 2b + 7, what is the value for y?”

 

Solution: 

Python outputs 23 as the solution.

 If (“if statement” in technical language)

Let’s say you want to output the input value only if it’s greater than 10, otherwise (else) just output 0.

 In Math, this can be “represented” with a piecewise defined function: 


By doing the same thing in Python: 

Things to notice:

-        to define the code that goes inside if and else we use a colon, go to a new line and add some indentation: this tells Python that code is not something after the if/else, but part of it: you can indent using tabs or spaces, your choice!

-        “else” specifies the code executed only when all the conditions encountered before (in this case just an “if”) aren’t met

-        I defined the y variable only inside the if statement and this is ok for this example for the sake of simplification (and for showcasing the “else” condition), but on real life this should never happen, because by missing (for some reason) the definition of the y variable somewhere it would have led to crash the program when executing the last line “print(y)”, where Python wouldn’t have known what to print: a “safer” implementation would’ve been be the following…

 


For now we’ve only seen the example with two conditions, but how can you add more? Differently from what one could think, you cannot repeat the word “if” because that’s only for the first condition, and you cannot repeat the word “else”, because that’s only for the last, where all the previous conditions aren’t met. The solution is using another word, “elif”, which stands for “else if”: it’s called so practically because it’s something which only runs if the first condition isn’t met (else), but also only if it’s condition is met (if).

Anyway, talking about it is much more complicated than what the actual thing is, so here is an explanatory example (please remember I’m not writing “safe” code here): 


 The code I wrote above does the exact same thing than before, with a difference: when x is greater than 100, it becomes 100 (in simple words, 100 is the max value). A “small” but important thing to notice is that I put “x > 100” before “x > 10”: inverting the two conditions makes “x > 100” unreachable, as “x > 10” has “priority”.

 Comparison Operators

In the previous paragraph, I said greater than to indicate the symbol >. This seems obvious, but some symbols (ex. “greater than or equal to”, represented with ≥) cannot be used in programming languages, as they’re not (simplifying) standard/plain characters.

 Here’s a list of comparison operators you can use on your code:

-        greater than: >

-        less than: <

-        greater than or equal to: >=

-        less than or equal to: <=

-        equal to: ==
(notice there is a double equal, as the single equal is used for assignment *)

-        not equal to: !=

 

*          a = 1 (a is equal to 1) (assigning 1 to a)

is different from saying

a == 1 (is it a equal to 1?) (comparing a with 1)

 Now it’s your turn!

Get back at work here.

 Here’s the problem:

 “Numbers greater than 5 and the number 5 itself become 6, but only if they’re not the number 10, which instead becomes -1, while negative numbers become positive, but if they’re lower than -10, they instead become -10. Remaining numbers become 1.”

This time I left the solution below because the school ending is “approaching” and I’m not sure there’ll be another part anytime soon.

Hey! I’m watching you… cheater! ;-)   Don’t scroll down before trying to find a solution to the problem above!

 

Here’s the solution to the problem: 


 Today’s Blogger

Hi, I'm Giorgio Bellisario, a Liceo Scientifico student. My passion revolves around tech and everything computer-related. Coding is my favorite hobby, and I primarily focus on web development, crafting websites from scratch. If you're intrigued by all things tech and ethical "hacking", you've come to the right place.

Comments

Popular posts from this blog

5 Curiosities About Eurochocolate

  Hi, I'm Valerio and this is my first article for LET’S BLOG!, so I want to talk about something I really like and, well, almost everyone likes. What better than chocolate to have smooth start?

Benedictine and Franciscan Monks: Forgotten Inventors

   Usually, when we think of religious orders, these things come to mind: a cloister, an abbey, a library, prayer in solitude, detachment from the world… All this in the cradle of a period defined as "dark" by historiography up to Romanticism: the Middle Ages . In this period the monks - especially the Benedictines of the various orders - were the custodians of Judeo-Christian but also classical culture, since thanks to their patient and meticulous transcriptions as scribes we have received almost all of the Greek and Latin works which we study today. Today we are grateful to them first of all for this.   However, many do not know that many products - material and immaterial - that we consume and use every day, come from monks who, using their ingenuity nourished by a profound spirituality, invented them due to practical necessities.    Personally, I find it amazing!    Let's begin…   The heavy plow   Plows were a primary agri...

Celebrating 100 Years of Italo Calvino: a 20th Century Intellectual

Illustrazione digitale di Maria René Menacho, 2023, studentessa del Liceo artistico Volta di Pavia. Tecnica mista Exactly a century ago, on October 15, 1923, one of the greatest writers of the 20th century was born, destined to give us some of the richest and most complex works of 20th-century Italian literature. Italo Calvino was able to reconcile different themes and genres, blending forms and stylistic choices in a frantic attempt to give a face to the chaos of reality, ready to amaze us even today with their disarming relevance.