Answer:
def language(mystring, n):
if n > 0:
string_list = [x for x in mystring]
string_cont = ""
for character in string_list:
string_cont += character * n
print(string_cont)
Explanation:
When n is equal to 0, that is, n=0, The python program multiplies the characters of the string "mystring" by the integer variable "n" to output a string with all characters with the same count.
Answer:
The 10 types of computers include personal computers, desktops, laptops, tablets, hand-held computers, servers, workstations, mainframes, wearable computers and supercomputers.
Answer:
#include <iostream>
using namespace std;
int main() {
int num = 0, sum = 0;
do {
cin >> num;
if (num % 2 == 0) {
sum += num;
}
} while (num != 9999);
cout << "The sum of the even numbers is " << sum;
}
Answer:
16
Explanation:
+= is an assignment operator that adds a value to the existing value.