Answer:
Following are the code to this question:
def strip_r_o(val): #Defining a method strip_r_o that takes a parameter
r = "" #defining a string variable
for x in range(len(val)): # declaring a for loop that reads input value
if (not val[x] == "R") and (not val[x] == "O"): #declaring if block to check first character is not R and O
r=r+val[x] #add character values
print(r) #Print calculated value
val= input("Enter a string: ") #input value from user end
strip_r_o(val) #Calling strip_r_o method
Output:
Enter a string: Raju
a
aj
aju
Explanation:
Following are the description of the above python code:
- In the above code, a method "strip_r_o" is declared in which "val" variable is passed as a parameter, inside the method a string variable "r" is declared, that uses the for loop to removes "R and O" from the string value and store and print its values.
- In the next step, val variable is declared, that the input value from the user and call the "strip_r_o" method value.
It is d because I said it is
Answer:
c. Declarative programming
Explanation:
Software development life cycle (SDLC) can be defined as a strategic process or methodology that defines the key steps or stages for creating and implementing high quality software applications.
Some of the models used in the software development life cycle (SDLC) are;
I. A waterfall model.
II. An incremental model.
III. A spiral model.
In Computer programming, when a software program or application describes what the solution to a problem is but without highlighting (describing) how that problem is solved, it is generally referred to as declarative programming. Thus, it takes the perspective that software developers (programmers) define what needs to be accomplished by a software program or application to solve a problem without defining how that problem is solved.
Answer:
# hide_and_seek function is defined
def hide_and_seek():
# for loop from 1 to 10
# and print each number
for number in range(1, 11):
print(number)
# the last message is displayed on its own line
print("Ready or not, here I come!")
# the function is called
hide_and_seek()
Explanation:
The code is well commented. A sample image of the output when the code is executed is attached.
import datetime
name = input("What is your name? ")
age = int(input("How old are you? "))
year = datetime.datetime.today().year
print("Hello {}! You were born in {}.".format(name, year - age))
I hope this helps!