<jupyter_start><jupyter_text>2. Coding Basics**Questions**What are the data types in Python? What's a function?  Topics- Hello, World!- Variables and Data Types- Conditions and Loops- Functions  Hello, World!Python is a very simple language, and has a very straightforward syntax. It encourages programmers to program without boilerplate (prepared) code. Python uses indentation for blocks, instead of curly braces. Both tabs and spaces are supported, but the standard indentation requires standard Python code to use four spaces.<jupyter_code># This program prints Hello, world!

print('Hello, world!')
# Easter Egg

import this<jupyter_output><empty_output><jupyter_text>Variables and Data TypesA Python variable is a reserved memory location to store values. In other words, a variable in a python program gives data to the computer for processing.Python has five standard data types −- Numbers- String- List- Tuple- Dictionary NumbersPython supports two types of numbers - integers and floating point numbers. (It also supports complex numbers, which will not be explained in this tutorial). StringsStrings are defined either with a single quote or a double quotes.<jupyter_code>one = 1
two = 2
three = one + two
print(three)

hello = "hello"
world = "world"
helloworld = hello + " " + world
print(helloworld)<jupyter_output><empty_output><jupyter_text>Conditions and LoopsPython uses boolean variables to evaluate conditions. The boolean values True and False are returned when an expression is compared or evaluated.There are two types of loops in Python, for and while. For loops can iterate over a sequence of numbers using the "range". While loops repeat as long as a certain boolean condition is met.<jupyter_code># conditions

name = "John"
age = 23
if name == "John" and age == 23:
    print("Your name is John, and you are also 23 years old.")

if name == "John" or name == "Rick":
    print("Your name is either John or Rick.")
# Prints out 0,1,2,3,4

count = 0
while True:
    print(count)
    count += 1
    if count >= 5:
        break

# Prints out only odd numbers: 1,3,5,7,9
for x in range(10):
    # Check if x is even
    if x % 2 == 0:
        continue
    print(x)<jupyter_output><empty_output><jupyter_text>FunctionsFunctions are a convenient way to divide your code into useful blocks, allowing us to order our code, make it more readable, reuse it and save some time. Also functions are a key way to define interfaces so programmers can share their code.Functions in python are defined using the block keyword "def", followed with the function's name as the block's name.<jupyter_code># Define our 3 functions

def my_function():
    print("Hello From My Function!")

def my_function_with_args(username, greeting):
    print("Hello, %s , From My Function!, I wish you %s"%(username, greeting))

def sum_two_numbers(a, b):
    return a + b

# print(a simple greeting)
my_function()

#prints - "Hello, <NAME>, From My Function!, I wish you a great year!"
my_function_with_args("<NAME>", "a great year!")

# print sum of number 1 and 2
x = sum_two_numbers(1,2)
print(x)<jupyter_output>Hello From My Function!
Hello, <NAME> , From My Function!, I wish you a great year!
3
{'fraction_non_alphanumeric': 0.08015028177833437, 'fraction_numerical': 0.010018785222291797, 'mean_word_length': 4.556521739130435, 'pattern_counts': {'":': 1, '<': 19, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '588138', 'license': 'MIT', 'n_tokens_mistral': 937, 'n_tokens_neox': 877, 'n_words': 435, 'path': '2 Coding Basics.ipynb', 'repo_name': 'data-octo/python_beginner_advanced', 'size': '3200'}