subject

Assuming the user enters a positive integer n >= 2 and I want to write a program which tells the user if a number is prime or not. What should I replace in the following code with n = int(input("Enter n"))isvalid = Truei = 2while i*i <= n: if n%i == 0: isvalid = False else: isvalid = i += 1 if isvalid: print("n is prime")else: print("n is not prime")

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 19:40
Write the quartstogallons java class that declares a named constant to hold the number of quarts in a gallon (4). also declare a variable to represent the number of quarts needed for a painting job, and assign an appropriate value—for example, 18. compute and display the number of gallons and quarts needed for the job. display explanatory text with the values, for example:
Answers: 2
question
Computers and Technology, 22.06.2019 19:20
Write a program that prompts the user to input a string. the program then uses the function substr to remove all the vowels from the string. for example, if str = "there", then after removing all the vowels, str = "thr". after removing all the vowels, output the string. your program must contain a function to remove all the vowels and a function to determine whether a character is a vowel.
Answers: 2
question
Computers and Technology, 23.06.2019 20:00
Me ajude por favor , coloquei uma senha e não consigo tira-la no chorme
Answers: 2
question
Computers and Technology, 24.06.2019 00:50
Which of the following is not a key player in the sale of travel products?
Answers: 2
You know the right answer?
Assuming the user enters a positive integer n >= 2 and I want to write a program which tells the...
Questions
question
Mathematics, 06.01.2020 21:31
Questions on the website: 13722363