Results for “functions”

Showing 61–70 of 86

  1. Article Mini projects

    Base 6 Number System in Python

    …how to do it. Converting Decimal to Base 6 - Your Own Function The algorithm is straightforward: keep dividing the decimal number by 6 and collect the remainders. Those remainders, read in reverse…

  2. Article Mini projects

    Managing Astronaut Medical Data with Python

    …By the end of this mission, you'll have created a fully functional program with a graphical interface, perfect for keeping our space explorers in tip-top shape! Note : You can find the complete code…

  3. Article Mini projects

    Converting Temperatures in Python

    …beginner Python programmer should be able to handle them. Functions for converting temperatures Let's define 2 functions necessary for our calculations. These will be the celsius_to_kelvin and…

  4. Article Mini projects

    Python Random Module

    …the Cosmic Dice Now comes the exciting part! Let's write a function that randomly selects our destination: def select_random_destination(): # Choose a random planet destination =…

  5. Challenge

    Log to a file

    …the file back and print it, then add an append_entry() function that adds lines at the end without wiping what is there.

    Write the code Easy 2 stages files open with write
  6. Article Python Fundamentals

    Variables and data types in Python

    …signal_data = 3 + 4j # Complex number representation wave_function = 2.5 + 1.8j # Used in quantum physics calculations antenna_impedance = complex(100, 20) # Creating from real and imaginary parts…