Question 1 (2/4) Given the following Python code program fragment: a = 7 b = 4 X = 3.0 y = 1.5 sum = 0.0 c= a/b+y d = (a % b) - (b % a) z = x / / b +...
View the step-by-step solution to:

Question

hello, could one possibly assist with these. thanks!Annotation 2019-11-01</h1><p class='abPRemoveTitle'> 103202.jpgAnnotation 2019-11-01 103006.jpgAnnotation 2019-11-01 102935.jpg

Annotation 2019-11-01 102935.jpg

Question 1 (2/4)
Given the following Python code program fragment:
a = 7
b = 4
X = 3.0
y = 1.5
sum = 0.0
c= a/b+y
d = (a % b) - (b % a)
z = x / / b + b // a
sum = a + b + x + y
sum = sum + a
What are the final values of c, d, z and sum?

Annotation 2019-11-01 103006.jpg

Question 4 (1/2) Write a formatted print statement that prints the value of an integer variable n in a width
of 12 with a comma as the thousands separator.

Annotation 2019-11-01 103202.jpg

Question 9 (8/ 9) Write a while loop that counts the number of positive and negative integers that are
evenly divisible by 5 entered by a user. The loop should stop executing and print the
resulting counts when the user enters either 0 or a value not evenly divisible by 5.
Example: Enter first value: Q
Enter next value: fl Enter next value: Q Negatives: 1 Positives: 1

Top Answer

Question 9 SOURCE CODE p=0 ne=0 n = int(input("Enter first value: ")) while n % 5 == 0: if (n &gt;= 0): p=p+1... View the full answer

Screenshot from 2019-11-01 21-02-06.png

P=0
ne=0
3
n = int(input(&quot;Enter first value: &quot;) )
1- while n % 5 == 0:
5 7
if (n &gt;= 0):
P=p+1
else:
8
ne=ne+1
9
n = int(input(&quot;Enter next value: &quot;) )
10
11
12
print( '...

Sign up to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question