Results for “input”

10 results

  1. Article Mini projects

    Calculating Escape Velocity in Python

    …to do: We know the physics formula: v = √(2GM/r) We need input data: planet's mass and radius We must perform mathematical calculations We'll display the result in a readable format Sounds simple?…

  2. Article Mini projects

    Converting Temperatures in Python

    …of value retrieval or conversion. Therefore, using the input() function, we can get the menu choice and display the next command. choice = int(input("Enter 1 or 2 and press enter: ")) We assign the…

  3. Article Mini projects

    Managing Astronaut Medical Data with Python

    …4. Astronaut Personal Data Let's add some fields to input astronaut information. We're implementing setup_astronaut_tab and add_astronaut : def setup_astronaut_tab(self): #our name field…

  4. Article Mini projects

    Base 6 Number System in Python

    …Decimal") print("3. Decimal to Eridian symbols") choice = input("Pick an option (1/2/3): ") if choice == "1": num = int(input("Enter a decimal number: ")) result = np.base_repr(num, 6) print(f"{num}…

  5. Article Python Fundamentals

    Python Functions for Beginners

    …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 at the code inside. This article is…

  6. Article Python Fundamentals

    A Practical Guide to Getting Started with Programming

    …km away") print(f"Mars is {mars_distance:,} km away") input() Double-click on your file and run it! If you see the distances printed, congratulations - you've written working code! Check other python…

  7. Article Python Fundamentals

    How to Start Programming in Python Fast

    …# String age = 25 # Integer height = 5.9 # Float User Input and Output user_name = input("What is your name? ") print("Hello, " + user_name + "!") Basic Arithmetic a = 5 b = 3 print(a + b) # Addition…

  8. Article Mini projects

    Medical dispenser - Don’t trust the user

    …is "stupid" See the problem? We're trusting external input for something safety-critical. It's like having a security door that asks visitors to self-report whether they're authorized. Better…

  9. Article Python Fundamentals

    Variables and data types in Python

    …real-world space-related examples: # Converting string input from sensor to numerical data temperature_reading = "-173.5" celsius_temp = float(temperature_reading) # Converting string to float…