Answer:
number1 = int(input("Enter the first number: "))
number2 = int(input("Enter the second number: "))
result = 0
for i in range(number1):
result += number2
print(str(result))
Explanation:
Ask the user for two numbers
Initialize result as 0 to hold the multiplication of the numbers
Create a for loop that iterates "number1" times. In each iteration, add number2 to the result.
When the loop is done, print the result
Hey, i’m really bored too. Hope this helps
def pig_latin(word):
if word[0].lower() in 'aeiou':
word = word + 'way'
else:
t=''
for x in range(len(word)):
if word[x].lower() in 'aeiou':
break
if word[x].lower() == 'y' and x>0:
break
else:
t+=word[x].lower()
if word[0].isupper():
word = word[len(t):]+word[:len(t)].lower()+'ay'
word = word.title()
else:
word = word[len(t):]+word[:len(t)].lower()+'ay'
return word
word = 'test'
pl = pig_latin(word)
print(pl)
I wrote my code in python 3.8. I hope this helps.
Correctness is key. The other ones are optimizations at most. Although I would always include humor... ;-)