Answer:
Um, the last one should be it, there isn't any closing paragraph. But the second one is also weird because the comment is not properly finishes. The comment should be <!-- Sth -->
Answer:
Explanation:
The following code is written in Python and creates a function called create_sentence which takes in 2 parameters which are the number of spaces and the number of stars. Then it uses these values to create the sentence and return it.
def create_sentence(spaces, stars):
sentence = ""
for x in range(spaces):
sentence += " "
for x in range(stars):
sentence += "★"
sentence += "\n"
return sentence
Answer:
Explanation:
Python Code:
date = int(input("Enter today's day numerically: "))
if date == 15 :
print("it's Payday")
elif date == 30 :
print("it's Payday")
else:
print("Sorry, not a PayDay");
Code Explanation:
First get date integer value from input by using input() method in python.
After that check is entered date equals to 15 or 30 then print it's Payday and at the end if user enter other then 15 and 30 the print Sorry, not a PayDay in else clause.
Code Ouput
Enter today's day numerically: 15
it's Payday
Enter today's day numerically: 17
Sorry, not a PayDay
Answer:
import math
def isPerfectSquare(n):
s = int(math.sqrt(n))
return n == s*s
def countPerfectSquares(k,m):
q = 0
for i in range(k,m):
if isPerfectSquare(i):
q=q+1
return q
print(countPerfectSquares(10,40))
Explanation:
Note that this is including the k, but excluding m. If you want to include m, write m+1 in the range expression.
The answer would be D. New Slide