Answer:
digital subscriber line
Answer:
I am writing Python program.
string = input("Enter a string: ")
print(string.count(' '))
Explanation:
The first statement takes input string from the user.
input() is used to read the input from the user.
The next statement uses count() function to count the number of times the specified object which is space ' ' hereoccurs in the string.
The print() function is used to return the number of times the space occurs in the string entered by the user.
Output:
Enter a string: How are you doing today?
4
The screenshot of program and its output is attached.
Answer:
vowels = ("a", "e", "i", "o", "u")
word = input("Enter a word: ")
is_all = True
for c in vowels:
if c not in word:
is_all = False
if is_all == True:
print(word + " is a vowel word.")
else:
print(word + " is not a vowel word.")
Explanation:
Initialize a tuple, vowels, containing every vowel
Ask the user to enter a word
Initially, set the is_all as True. This will be used to check, if every vowel is in word or not.
Create a for loop that iterates through the vowels. Inside the loop, check if each vowel is in the word or not. If one of the vowel is not in the vowels, set the is_all as False.
When the loop is done, check the is_all. If it is True, the word is a vowel word. Otherwise, it is not a vowel word.
Answer:
Scope creep is defined as the uncontrolled changes occur in the projects scope is known as scope creep. It basically occur when the project scope are not properly define and controlled.
Suggestions for preventing scope creep in projects are as follow:
The overall goal of this function is to take a list of words that we got as input, a list of words to check for if they appear in the input outputs to return if something from the list to check is in the input list.
Define a function, called selector.
This function should have the following inputs, outputs and internal procedures:
Input(s)
input_list - list of string
check_list - list of string
return_list - list of string
Output(s):
output - string, or None
Procedure(s):
Initialize output to None
Loop through each element in input_list
Use a conditional to check if the current element is in check_list
If it is, assign output as the returned value of calling the random.choice function on return_list
Also, break out of the loop
At the end of the function, return output Note that if we don't find any words from input_list that are in check_list, output will be returned as None.
Answer:
See explaination
Explanation:
# Import required the module.
import random
# Define a function selector() which accepts the
# input_list, check_list, and return_list and
# returns a string named output.
def selector(input_list,check_list,return_list):
# Assign None to string variable output.
output=None
# Use for loop to traverse through input_list.
for i in range(len(input_list)):
# Check if element of an input_list is present
# in check_list.
if input_list[i] in check_list:
# Assign a random value from return_list
# to output.
output=random.choice(return_list)
# break out of the loop if input_list
# element is present in check_list.
break
#
return output
# Use assert statement to test a condition.
# If the condition is true, then program continues to
# execute, otherwise raises an AssertionError.
assert callable(selector)
assert selector(['is','in','of'],['of'], ['Yes']) == 'Yes'
assert selector(['is','in'],['of'], ['Yes','No']) == None
# Display the output.
print(selector(['is','in','of'],['of'], ['Yes']))
print(selector(['is','in'],['of'], ['Yes','No']))
Answer:
Expected CPU time: 1.875 seconds.
Answer:
Sample output:
Enter integer 3232423
true
Enter integer 12131231
false
Explanation:
Above is the output of the program and for the solution check the screenshots attach to understand clearly the program.
Thanks