Icon
Login    Register          




Most Advanced AI

Generate Code at the speed of Thought

Improve Productivity of Developers



Python Problems

Please note that all the programs are generated using "Code in English" wherein the problems are entered and the code is generated by the system. To use this product, please register and get a free trial for 7 days.

Register to get Free Access

Problem 1:
print Hello World! on the screen.

print("Hello World!")

Problem 2:
Compute 2 + 3*5 and display the result.

print(2 + 3*5)

Problem 3:
compute factorial of 100

import math

print(math.factorial(100))

Problem 4:
Compute square and cube of 15.

import math

def square(x):
    return x**2

def cube(x):
    return x**3

def main():
    print("Square of 15 is:", square(15))
    print("Cube of 15 is:", cube(15))

if __name__ == "__main__":
    main()

Problem 5:
Compute square root of ten and display the result.

import math

# Compute square root of ten.
root = math.sqrt(10)

# Display the result.
print(root)

Problem 6:
Accept two floating numbers from the user. Compute addition, subtraction, multiplication, and division of these numbers.

a = float(input("Enter first number: "))
b = float(input("Enter second number: "))

print("Addition: ", a + b)
print("Subtraction: ", a - b)
print("Multiplication: ", a * b)
print("Division: ", a / b)

Problem 7:
Generate two random numbers. Compute addition, subtraction, multiplication, and division of these numbers.

import random

def main():
    num1 = random.randint(1, 100)
    num2 = random.randint(1, 100)
    print("The first number is:", num1)
    print("The second number is:", num2)
    print("The sum of the two numbers is:", num1 + num2)
    print("The difference of the two numbers is:", num1 - num2)
    print("The product of the two numbers is:", num1 * num2)
    print("The quotient of the two numbers is:", num1 / num2)

main()

Search Menu



Disclaimer:
Patodia Infotech Private Limited (fastdevai.com) has no responsibility for any text or code generated or for any action taken by you based on the contents provided by this web site. The use of this web site is solely at the user's risk. All the services are provided with the understanding that Patodia Infotech Private Limited or any other person or company associated with this company or website are not responsible for any loss or damage occurring to anybody from any code or contents generated by this website. Please note that text, codes and contents are generated by AI. These are state-of-the-art AI solutions. However, these are AI tools so there is no guarantee of accuracy of any code or contents generated.


Copyright © 2021-2024 Patodia Infotech Private Limited, All Rights Reserved.