Results for “print”

Showing 1–10 of 15

  1. Article Python Fundamentals

    Python print() Function

    Master Python's print() function in space programming! Learn to display satellite data, format cosmic measurements, and create mission logs with this essential programming tool.

  2. Article Python Fundamentals

    Python Functions for Beginners

    …even a few lines of Python, you've already used functions. print() is one. So are len() , input() and int() . Somebody wrote them, gave each one a name, and now you can use them without ever looking…

  3. Article Python Fundamentals

    Nested Loops in Python

    …one row of Mars surface for x_position in range(5): print(f"Scanning position X: {x_position}") This gives us: Scanning position X: 0 Scanning position X: 1 Scanning position X: 2 Scanning position X…

  4. Article Mini projects

    Medical dispenser - Don’t trust the user

    …hack in action: dispenser = NaiveMedicationDispenser() print(dispenser.request_dose(datetime.now())) # First dose works print(dispenser.request_dose(datetime.now())) # Denied - too soon # The "clever"…

  5. Article Mini projects

    Calculating Escape Velocity in Python

    …small number) # NumPy handles these numbers efficiently print(f"Earth's mass: {earth_mass}") # Will display: 5.972e+24 print(f"That is: {earth_mass:,.0f}") # Will display with all zeros Note: The…

  6. Article Python Fundamentals

    Numbers and Basic Math Operations in Python

    …= travel_time + surface_operations + return_time print(f"Total Mars mission duration: {total_mission_time} days") # Calculating remaining fuel (liters) initial_fuel = 1000000 used_fuel = 850000…

  7. Article Mini projects

    Python Random Module

    …1000) # days crew_size = random.randint(3, 8) print(f"Mission Brief") print(f"Destination: {planet}") print(f"Distance: {details['distance']} million km") print(f"Surface type: {details['surface']}")…

  8. Article Mini projects

    Converting Temperatures in Python

    …selection menu We display the selection menu using the print() function: print("Choose the type of conversion:") print("1. Temperature in degrees Celsius to temperature in degrees Kelvin.") print("2…

  9. Article Mini projects

    Base 6 Number System in Python

    …digits.reverse() return "".join(digits) # Let's test it print(decimal_to_base6(12)) # Output: 20 print(decimal_to_base6(36)) # Output: 100 print(decimal_to_base6(101)) # Output: 245…

  10. Article Python Fundamentals

    Variables and data types in Python

    …"ISS", "Hubble", "ISS"} # Note: ISS appears only once print(signal_sources) # Output: {'Voyager1', 'ISS', 'Hubble'} # Finding common observation targets between telescopes telescope1_targets =…