In python,
Write a function that will ask user to enter a number and find if it is odd or even.
Example run:
Please enter a number: 5
5 is an odd number
Please enter a number: 10
10 is an even number
def even_or_odd():
n = int(input('Please enter a number: '))
if n % 2 == 0:
print(str(n) + ' is an even number')
else:
print(str(n) + ' is an odd number')
even_or_odd()

In python, Write a function that will ask user to enter a number and find if...
IN PYTHON. Write a function that ask the user to (a) enter a string, (b) ask the number of time to repeat the string and (c) ask user to input a delimiter to separate them. Call the function and append the test run to your solution. Here is a test run of what is wanted: Enter a string: Ted How many repetitions? 10 Separated by? [}(+ Ted[}(+Ted[}(+Ted[}(+Ted[}(+Ted[}(+Ted[}(+Ted[}(+Ted[}(+Ted[}(+Ted
Write an assembly code that ask the user to enter a number and put it in variable called ''num1'' and check if number in variable num1 , is positive even or positive odd or negative even or negative odd If number is positive even , put the number into variable called '' positiveEven '' and show a message '' the number is positive even'' If number is negative even , put the number into variable called '' negativeEven'' and show...
Write a code using loop and flag function in python jupitior notebook: Ask the user for the number of items they bought. Also ask the price of each item they bought and quantity purchased. Display the total amount they owe. Ask the user for a number n. Calculate 1+2+3+….+n. Ask the user for a number n. Calculate 1*2*3*…*n. Ask the user for number of rows (r) and columns (c). Print * for r rows and c columns. Ask the user...
Write a python program that does the following. a. It asks the user to enter a 5-digit integer value, n. b. The program reads a value entered by the user. If the value is not in the right range, the program should terminate. c. The program calculates and stores the 5 individual digits of n. d. The program outputs a “bar code” made of 5 lines of stars that represent the digits of the number n. For example, the following...
IN PYTHON
write a program that asks the user to enter 10 numbers and store them in the list and then find the followings: • Maximum • Minimum prime numbers in the list • even numbers in the list • odd numbers in the list.
please solve using python
thank you!
Write a program which prompts the user to enter a number of rows, and prints a hollow square star pattern with 2 diagonals. Note: you can assume that the integer will always be > 1 and will be an odd number. For example: Input Result 5 Enter number of rows: 5 ***** ** ** * * * ** ** ***** 9 Enter number of rows: 9 ** ** ** * * * * *...
Question 4 (3 mark) : Write a Java program to ask the user to input an integer number from the keyboard. The output should indicate whether it is positive, zero, or negative, an even number or an odd number. REQUIREMENTS • Your code should ask user to input an integer number, then decide its sign and parity based on this input. • Your code should use if-else statement. Your code must work exactly as the specification and the output should...
Using python for this programming Factorial Ask the user to enter an integer number. Then print the factorial of that number Write a program to print the below ******** (note: 8 stars) ******* ****** ***** **** *** ** * Ask the user to enter the speed of their car. Write an if-else statement that displays “Speed is normal” if the speed variable is within the range 24 to 56. If speed variable is outside this range it should display “speed...
Write a program to print the hollow diamond of stars (*), ask
the user to enter an odd number as the height. For example, if user
enters height as 7, output will look like:
Y*
Problem 1 Write a Python program to do the following: (A) Ask the user to enter as many integers from 1 to 10 as he/she wants. Store the integers entered by the user in a list. Every time after the user has entered an integer, use a yes/no type question to ask whether he/she wants to enter another one. (B) Display the list. (C) Calculate and display the average of the integers in the list. (D) If the average is...