Write a python function Write_String(fanme, *list) which take a list containing string elements and write them in a file myfile.txt until the string “finish” (not case sensitive) occur. The function then returns the contents written in file as a string. Before writing list elements in file, you also need to make a separate python function to check whether input list contains "Finish" or not. If not, then it should return error as shown in example.
myfile.txt:
Python
Java
C
C++
Ruby
.Net
Example-1
Example-2
Example-3
Input:
myfile.txt
["Python", "Java", "C", "C++", "Finish"]
Output:
PythonJavaCC++
Input:
myfile.txt
["Python", "Java", "C", "C++", "Finish",".Net", "Rubby"]
Output:
PythonJavaCC++Input:
myfile.txt
["Python", "Java", "C", "C++"]
Output:
Error: List does not contain Finish
WAP in C++ :
Write a program whose input is two integers, and whose output is the first integer and subsequent increments of 5 as long as the value is less than or equal to the second integer.
Ex: If the input is:
-15 10the output is:
-15 -10 -5 0 5 10Ex: If the second integer is less than the first as in:
20 5the output is:
Second integer can't be less than the first.For coding simplicity, output a space after every integer, including the last.
We Filipinos are quite known for the habit of leaving at least one of the many pieces of food on the plate as it can't be equally divided among all at most times. Just like when 3 people decide to eat a pizza of 10 slices, there will often be at least one slice left on the box. To accurately show just how many pieces of things are left when divided by a certain number, we code it using modulo.
Care to do it for me?
Input
A line containing two integers separated by a space.
10·3Output
A single line containing an integer.
1Create a program that will use a function, that will perform and display the sum, difference, product, and quotient of 2 numbers.
Write a c++ program to display the Fibonacci series of the first 50 integer
Binomial births In the U.S., 49% of births are female. Assume the sexes of babies are independent of each other. Find the following probabilities using stats.btnom.pnf, stats, binom.cdf, and arithmetic. The stats library of scipy has been imported in the top cell of this notebook. (a) Find the chance that among 20 births, the majority (more than half) are female. Save your answer in the variable called port
Make a Mortgage Calculator code
Make a Mortgage Calculator Test code
a. (overSpeed > 10) ? fine = 200 : fine = 75;
b. (fuel >= 10) ? drive = 150 : drive = 30;
c. (bill >= 50.00) ? tip = 0.20 : tip = 0.10;
Create a class called Team that will be used for creating team objects, the class must have the
following data members and methods:
Data Members:
Name,the name of the team
HomeGround, the name of the Home stadium of the team
Goals, the number of goals that the team scores during the match
Choose appropriate types for the data members
Methods:
A default constructor which will initialize all data members to proper initial values
An overloaded constructor which receives two arguments; a team name and home
ground name and it should also initialize the goals to a proper initial value
scoreGoals(), since a team can score 0 to 4 goals, this helper method must assign the
Goals data member to a random number in that range
getName(), getHomeGround(), getGoals(), create get methods for each data member