About 12,300,000 results
Open links in new tab
  1. How to run the math from an input in python - Stack Overflow

    Feb 28, 2017 · I am creating a game in python where I need to run basic math operations. These operations would be provided by a user as input. How do I do this? So far, I have independent …

  2. python - Getting mathematical function as user's input - Stack Overflow

    Apr 29, 2017 · if you want to turn the user input into a function you can call you could to this: from sympy.utilities.lambdify import lambdify f = lambdify (x, expr) # f (3.14) -> -1.322... sympy can …

  3. How to use user inputed mathematical integer function?

    func = input("Input a function: ") def f(k): return func g = (f(k) for k in range(max)); A.update(g); print("A = ", A) This returns A = {'2*k+1'}, if I give it 2*k+1 as input. How do I get it to work like …

  4. How to Receive User Input in Python: A Beginner’s Guide

    Feb 14, 2025 · In this tutorial you will learn various ways to receive user input in Python, including the input () function, command-line arguments, GUI-based input handling, and best practices …

  5. User Input & Math Functions: Making Your Python Programs …

    Jan 29, 2025 · In this post, we’ll explore how to handle user input and perform mathematical operations in Python, equipping you with the tools to build smarter applications. 1. Handling …

  6. Performing Basic Mathematical Operations with Variables in Python

    May 8, 2023 · In real programs, we often want to get input from the user for our variables rather than hardcoding values. The input () function allows us to accept user input in Python. Here is …

  7. How to Use the Input() Function in Python? - Python Guides

    Feb 10, 2025 · Here’s how you can use the input() function to capture the user’s name and age: print("Hello, " + name + "! You are " + age + " years old.") Output: You can look at the output in …

  8. User Input - Problem Solving with Python

    To begin this chapter, Python's input() function is discussed. Python can be used to ask users for input. The input entered by a user can be saved to a variable and used in subsequent parts of …

  9. Learn Python Basics: Doing Math and Converting User Input

    Jan 2, 2024 · Master Python basics with this tutorial! Explore math operations and convert user input using the input function.

  10. How to Get User Input in Python - CodeRivers

    Jan 29, 2025 · The most common way to get user input in Python is through the input() function. The input() function takes an optional string argument, which is used as a prompt to the user. …

  11. Some results have been removed
Refresh