## Daily Python Puzzle: The Range Function

What is the output of this code snippet?   [python] print(sum(range(0,7))) [/python]   Do you know the following story of the brilliant mathematician Carl Friedrich Gauss? When 8-year old Gauss went to school, his math teacher sought a few minutes of breathing pause. He told his class to solve the problem of adding all subsequent …

## Daily Python Puzzle: Auto String Concatenation

What is the output of this code snippet?   [python] x = ‘py’ ‘thon’ print(x) [/python]   A well-designed puzzle conveys one single point that surprises the reader. This puzzle introduces a language feature that surprised me when I first saw it. The Python interpreter automatically concatenates two strings that are next to each other. …

## Daily Python Puzzle: String Concatenation

What is the output of this code snippet?   [python] print(3 * ‘un’ + ‘ium’) [/python]   Python has powerful built-in capabilities for string manipulation. Web companies like Google love Python because it is a perfect fit for the text-based World Wide Web. The puzzle introduces two basic string manipulation operators. The ‘+’ operator concatenates …

## Python Integer Division [2-Min Tutorial]

Integer division consists of two steps: Perform normal float division a / b. Round the result down to the next integer. What is the output of this code snippet? [python]x = 50 // 11print(x)[/python] When I started to learn Python 3, I used to be confused about the semantics of dividing two integers. Is the …

## Daily Python Puzzle: Slicing

What is the output of this code snippet?   [python] word = "galaxy" print(len(word[1:])) [/python]   More than one out of four Finxter users can not solve this puzzle. There are two concepts that are novel for them: the len() function and slicing. The len() function is a handy tool to get the length of …

## Basics of Boolean Logic: A Short Guide

What is the output of this code snippet?   [python] # Influential reddit users # in million karmas way_fairer = 2.7 StickleyMan = 2.3 _vargas_ = 2.3 smeeee = 1.3 a = way_fairer > StickleyMan b = StickleyMan < smeeee and a c = _vargas_ >= StickleyMan c = a and b or c and …