Answer:
userpassword = {"123456",
"password",
"123456789",
"12345678",
"12345",
"111111",
"1234567",
"sunshine",
"qwerty",
"abc123"}
#We define the function that prompts the user for a password
def user_passinput():
password = input("Choose enter a password: ")
return password
#Function that checks the password
def check_password():
count = 0
check_pass = user_passinput()
if check_pass in userpassword:
print("Yay!! you entered the correct password")
elif count <10:
count = count+1
print("Please try again")
user_passinput()
else:
print ("Maximum tries exceeded")
check_password()
Explanation:
Using Python for this code, in the first line of the code, we list the dictionary of 10 most common passwords searched on the web. In line 12, we define the function that will demand the user to enter a password and return the value the user entered. Line 16 defines the function that checks if the password is common and prints to the screen either "Yay!! you entered the correct password", "Please try again" or "Maximum tries exceeded" depending on the condition that is satisfied. The last line of the code calls the check_password() function, which actually initiates the designed program.
Yes, all the time. Sometimes, it's feeling based. You get a bad vibe from someone, and you tend to go without without really giving said person a chance. Sometimes those vibes are helpful, sometimes it's you overreacting from bad experiences. (: hope all is well!
Answer:
Explanation:
For the first questions the variable's name is <u>Today,</u> and is declared like a date variable, this will be returned a date value.
For the second question, where the browser will show today's date because with the variable Today, we get the date and with the document.write(Today) is shown the variable information.
With the third question, the result will be "Hello!", because the August is the 8 month, and July the 7, in this case the IF is False and for that will show "Hello!".
Answer:
#here is code in Python.
#read the value n from user
n=int(input("enter the value of n:"))
#variable to store the total sum
sum_n=0
for i in range(1,n+1):
# find the sum of series
sum_n=sum_n+1/i
#print the sum
print("sum of the series is: ",sum_n)
Explanation:
Read the value of n from user. Create and initialize a variable sum_n with 0. Run a for loop to calculate sum.Initially sum_n is 0, then for value of i=1 1/i will be added to the sum_n.Then in next iteration for i=1, 1/2 added to sum_n. Similarly loop will run util i equals to n.Then sum_n will store the sum of the
series.
Output:
enter the value of n:5
sum of the series is: 2.283333333333333