Hey here is my code in c++ as i am more proficient in that. If you are familier with python then it is easy for you to just see the for loops and implement it in python
#include <iostream>
using namespace std;
int main()
{
int n=7;
int i,j;
int sp=0;
for(int i=0;i<=n-1;++i)
{
for (j=1;j<=sp;j++) cout<<" ";
sp++;
for (j=1;j<=2*(n-i);j++) cout<<"*";
cout<<endl;
}
sp--;
for (j=1;j<=sp;j++) cout<<" ";
cout<<"*"<<endl;
for (j=1;j<=sp;j++) cout<<" ";
cout<<"*"<<endl;
sp=n-1;
for(int i=1;i<=n;++i)
{
for (j=1;j<=sp; j++) cout<<" ";
sp--;
for (j=1;j<=2*i;j++) cout<<"*";
cout<<endl;
}
return 0;
}
Using PYTHON 5 nt code ven in this question draw small squares and lines exceperian You...
Write 3 lines of Python code that use a for loop to place the squares of the integers 1 to 10, in ascending order, in an initially empty list called FeedMeSquares.
Python
#complete the following lines of code wherever indicated. 5 question 20 points a piece #you may use your book and internet but no form of messaging or communication #QUESTION 1 #Read in the file exam_file.txt #Print to the console every other line #QUESTION 2 #Read in exam_file.txt #split file into words #write to a file called question2.out that contains 1 word per line (words can occur more than once) #QUESTION 3 # Print out all the Middle Initials in...
Python
#complete the following lines of code wherever indicated. 5 question 20 points a piece #you may use your book and internet but no form of messaging or communication #QUESTION 1 #Read in the file exam_file.txt #Print to the console every other line #QUESTION 2 #Read in exam_file.txt #split file into words #write to a file called question2.out that contains 1 word per line (words can occur more than once) #QUESTION 3 # Print out all the Middle Initials in...
Write a code in Python to print the following lines on the screen. Submit your code here, when it is completed. This is my first real project in Python. It seems very interesting and I cannot wait to learn more about it!
Write a code using Turtle graphics to draw the plus sign. (On python idle 3.7.2)
please write in python. thank you
In this question you will be writing the code to carry out a query on a database table in Python. The CREATE command shown below is given just for your reference, so that you know the structure of the table and its columns. The database is an SQLite database in the file named taxa.sqlite. create table species ( id int primary key, genus varchar ( 5 0 ), species varchar(50), common_name char(100) ) Write...
(ON PYTHON IDLE 3.7.2)
Write a code to draw the following pattern:
Write a code to draw the following pattern:
*PYTHON EXPERTS ONLY PLEASE* Please provide the answer coded in Python using comments to explain code function. Good answers will be rated with thumbs up! Please answer both parts. Thank you for your time. Question 3 - Suppose you have a file named numbers.csv which contains a bunch of integers, five per line of text, separated by commas. Write code below that will open the _le, read the numbers from it, and print the sum of all the even numbers...
This is for programming using Python with the JES software. Please write the code with the proper indentation. Thanks! Problem 1: Write a function that takes 2 arguments (integer or float) and computes the sum, difference, product, and quotient of the arguments. Once you calculate the values you should print out statements telling the user what arguments we used to compute the values and what the result of each calculation (your function should produce 5 lines of output in the...
Please help with this python assignment. Thank you. question 1 Write a Python program to read a file line by line store it into a variable. question 2 Write a Python program to read a file line by line store it into an array. question 3 Write a python program to find the longest words. question 4 Write a Python program to count the number of lines in a text file. question 5 Write a Python program to count the...