Study guide Intro to PYTHON questions:




25)Code:
a=1
while(a<3): #two times loop for first 3 lines and second 3
lines
b=1
while(b<4): #loop for each line means
A,B,C
c=1
if(b==1):
s='A'
elif(b==2):
s='B'
else:
s='C'
while(c<15): #loop
for print 3#'s and 8 Characters(A or B or C) and 3 #'s
if(c<=3):
print("#",end="")
elif(c>3 and c<12):
print(s,end="")
else:
print("#",end="")
c=c+1
print("")
b=b+1
a=a+1
Code snippet 25:
![a=] while (a<3): #two times loop for first 3 lines and second 3 lines b=1 while (b<4): #loop for each line means A,B,C c=1 if](http://img.homeworklib.com/questions/cf91dc30-6dbc-11eb-9233-01edb729bfc8.png?x-oss-process=image/resize,w_560)
Output 25:

26) Code:
n=int(input("Size?")) #asking input size
i=1;
j=1;
while(i<=n):
j=1;
while(j<=i):
print("*",end="");
j=j+1;
print()
print()
i=i+1
Code snippet 26)

Output 26:

23)Code:
def study_calculator():
a=int(input("How many weeks do you want to
calculate? "))
i=1
c=0;
while(i<=a):
b=int(input("How many hours
did you spend for this week? "))
c=c+b;
i=i+1;
print("Total amount of hours spent on study
for",a,"weeks are",c)
study_calculator()
Code snippet 23:

Output 23:

22)Code:
def total_volume():
width=int(input("please input a width:"))
while(1):
if(width<=0):
print("Width must be positive")
width=int(input("please input a width:"))
if(width>0):
break
length=int(input("please input a
length:"))
while(1):
if(length<=0):
print("length must be positive")
length=int(input("please input a length:"))
if(length>0):
break
height=int(input("please input a
height:"))
while(1):
if(height<=0):
print("height must be positive")
height=int(input("please input a height:"))
if(height>0):
break
units=(input("please input a units:"))
vol=width*length*height
print("The volume of the object is",vol,end="
");
print(units,"^3");
total_volume()
Code snippet 22:

Output 22:

Study guide Intro to PYTHON questions: 25) Write the code that will generate this output using...
Write the code in Python. The output should be exact the same as
the given.
Question 1. Study the examples below carefully and write a program for journal subscription Your program should work exactly as the following examples The text in bold indicates user input. Example 1: The user is a student, and the user subscribes to 2 journals Question 1 - Journal of Commodity Markets Journal of Sustainable Mining Journal of Asia-Pacific Biodiversity Student $21 $22 $27 Non-student $50...
Write a program which will Ask the user a series of questions using the Scanner object Based on the input, draw a grid of star figures on the DrawingPanel You program should ask your user: . What R, G & B values to create a color to draw the figure? How many stars across should the fgure be? How many stars tall should the figure be? Note that your program does not need to error check the users responses Your...
For Python: (Use # comments to explain each line) Write code that prints an octagon shape using stars, by prompting the user for the octagon side length. For example: "How long should each side of the octagon be? " Then takes this input, and prints an octagon in stars using the user input.
1) Translate the following equation into a Python assignment statement 2) Write Python code that prints PLUS, MINUS, O ZERO, depending on the value stored in a variable named N. 3) What is printed by: 3 - 1 while 5: while 10 Print ) Page 1 of 9 4) Write a Python while loop that reads in integers until the user enters a negative number, then prints the sum of the numbers. 1-2 of 9 4) Write a Python while...
Only use the code in Objectives and write the code in Python
Question 1. Study the examples below carefully and write a program for journal subscription Your program should work exactly as the following examples The text in bold indicates user input. Example 1: The user is a student, and the user subscribes to 2 journals Question 1 - Journal of Commodity Markets Journal of Sustainable Mining Journal of Asia-Pacific Biodiversity Student $21 $22 $27 Non-student $50 $60 $75 Are...
C++
please use only easy code and stdio.h because im just a
beginner
Description Write the program that can manage the information of students as follows: S 1. This program has two phase; the input phase and the output phase. 2. In an input phase, a teacher inputs the information (name, score, and department) for each student. The total number of students who can be inputted should be defined as a NUM OF_STUDENT constant value. In this example, the value...
(PYTHON) Write a program that displays the following menu:. , Write Algorithm for Code Geometry Calculator 1. Calculate the Area of a Circle 2. Calculate the Area of a Rectangle 3. Calculate the Area of a Triangle 4. Quit Enter your choice (1 - 4): If the user enters 1, the program should ask for the radius of the circle and then display its area. If the user enters 2, the program should ask for the length and width of...
PYTHON PLEASE Write a function to censor words from a sentence code: def censor_words(sentence, list_of_words): """ The function takes a sentence and a list of words as input. The output is the sentence after censoring all the matching words in the sentence. Censoring is done by replacing each character in the censored word with a * sign. For example, the sentence "hello yes no", if we censor the word yes, will become "hello *** no" Note: do not censor the...
read instructions carefully please matlab only
Write a MATLAB function for a BMI calculator that receives the inputs for body weight (lbs)and height (ft) from the user's program, calculates the BMI using the equation below, displays the BMI category, and outputs the BMI value tothe user's program W (kg) h2 (m2) BMI Display Normal if 18.5 s BMI 25 Display Overweight if 25 s BMI <30 Display Obese if BMI 2 30 Else display underweight So you will create two...
#PYTHON#
In this exercise you will write code which loads a collection of
images (which are all the same size), computes a pixelwise average
of the images, and displays the resulting average.
The images below give some examples that were generated by
averaging "100 unique commemorative photographs culled from the
internet" by Jason Salavon. Your program will do something
similar.
Write a function in the cell below that loads in one of the sets
of images and computes their average....