Docsity

Assignment 4 Problems - Introduction Computer Programming Non Majors | CSC 1310, Assignments of Computer Science

Toggle sidebar
bg1
Assignment 4
Question 1: Please write a python program that assumes user input a number (e.g., 5).
Based on that number, python will print out the Pyramid like the following graph
with height of the number. (50 pts) (Hint: you may separate the whole graph into two
sub graphs).
*
**
***
****
*****
****
***
**
*
Question 2:
2.1 What would be the exact printed output produced by the following segment of code:
(10pts)
2.2 What would be the exact printed output produced by the following segment of code:
(10pts)
pf2

Partial preview of the text

Download Assignment 4 Problems - Introduction Computer Programming Non Majors | CSC 1310 and more Assignments Computer Science in PDF only on Docsity!

Assignment 4

Question 1: Please write a python program that assumes user input a number (e.g., 5). Based on that number, python will print out the Pyramid like the following graph with height of the number. (50 pts) (Hint: you may separate the whole graph into two sub graphs).

**






**

Question 2: 2.1 What would be the exact printed output produced by the following segment of code: (10pts) 2.2 What would be the exact printed output produced by the following segment of code: (10pts)

2.3 What would be the exact printed output produced by the following segment of code: (10pts) Question 3: If we have a piece of codes written as: What is the value of aa, bb, cc, dd? (20 pts) aa: 100 bb: - cc: ‘hahahahahaha’ dd: error