Results for “functions”

Showing 71–80 of 86

  1. Article Python Fundamentals

    Python Books for Beginners

    …Python fundamentals (variables, lists, dictionaries, functions, classes), while the second half walks you through three complete projects - a Space Invaders-style game, data visualization, and a web…

  2. Challenge

    Statistics module

    …The check looks for the module and makes sure your own functions are gone. Spread, and too little data Now there are three passes. For each, print the mean, the median and the standard deviation…

    Fix the code Easy 2 stages statistics mean median stdev
  3. Challenge

    Readings summary

    …the summary. Summarise the readings with Python's built-in functions, then make sure the summary survives a pass with no readings at all. Min, max, mean Print the lowest and the highest reading, and…

    Write the code Easy 2 stages lists min max sum
  4. Challenge

    Round or cut?

    …see your prediction next to what Python printed. The two functions handle the decimals differently. What does each one give for 1499.7? Investigate and modify Investigate. Store what int(2.9) gives in…

    Write the code Medium 3 stages int round rounding type conversion
  5. Article Python Fundamentals

    Python If/Else for Beginners

    …consider combining conditions or extracting logic into functions. Chained comparisons Python supports expressions like a < b < c , which are evaluated sensibly: altitude = 1200 if 1000 < altitude <…

  6. Article Python Fundamentals

    A Practical Guide to Getting Started with Programming

    …can also follow this daily routine: Learn basics, syntax, functions, data structures Code a little bit every day (even 30 minutes helps) Try to understand code instead of copying it Modify existing…

  7. Article Python Fundamentals

    Numbers and Basic Math Operations in Python

    …operations Using Python's built-in mathematical functions Performing unit conversions Analyzing space mission data Exercises Try solving these exercises to test your understanding of Python's number…

  8. Article Mini projects

    Calculate your weight on different planets in Python

    …each pair are separated by a colon. Next, let's create a function to calculate weight: def calculate_weight(mass, gravity): return mass * gravity This function multiplies mass by gravity to get…

  9. Article Mini projects

    Drawing Planetary Orbits in Python

    …4. Creating Planets and Orbits Now, let's create a function to generate planets and another to calculate their orbital paths: def create_planet(color, size): planet = turtle.Turtle()…