Answer:
Answer:
def main():
num = int(input("Input a number to check for prime: "))
if num > 1:
for i in range(2,num):
if (num % i) == 0:
print("%d is not a prime number" % num)
break
else:
print("%d is a prime number" % num)
break
else:
print("%d is not a prime number" % num)
if __name__ == "__main__":
main()
Explanation:
Solution retrieved from programiz.com.
Note, this program uses the idea of the Sieve of Eratosthenes to validate the input number by using the modulo operator to determine primeness.
The program will output to the user if the number input is indeed prime or not.
Cheers.
Explanation:
Answer:
Here you go, Change it however you'd like :)
Explanation:
import random as r
def play_round(p1, p2):
cards = [1,2,3,4,5,6,7,8,9,10,"J","Q","K","A"]
play1 = r.choice(cards)
play2 = r.choice(cards)
while play1 == play2:
play1 = r.choice(cards)
play2 = r.choice(cards)
if cards.index(play1) > cards.index(play2):
return f"{p1}'s Card: {play1}\n{p2}'s Card: {play2}\nThe Winner is {p1}"
else:
return f"{p1}'s Card: {play1}\n{p2}'s Card: {play2}\nThe Winner is {p2}"
print(play_round("Bob","Joe"))
Answer:
She made the first computer.
Explanation:
Augusta Ada King, Countess of Lovelace (née Byron; 10 December 1815 – 27 November 1852) was an English mathematician and writer, chiefly known for her work on Charles Babbage 's proposed mechanical general-purpose computer, the Analytical Engine.
Answer:
can only be carried out by computers, as long as an interpreter is available which one is it?
Explanation:
The interperetor needed is called CPython, this is the standard C implementation of the language.