print(“2 + 7”)
print(3 + 1)
Answer:
line 1 = 2+7 (you added quote marks)
line 2 = 4 (you did not add quote marks, which adds both nums together)
Explanation:
Answer:
There are various answers that are all correct.
Explanation:
An efficient code will take less time to compile and execute. It is less noticeable in small programs but in larger ones it becomes apparent. You would rather press start and have your program give you your values immediately rather than wait 20 seconds every time.
An efficient code will be easier for you to find mistakes in if there are errors when compiling, being smaller and easier to read.
It will be easier to make small changes to an efficient program that for example, used global variables instead of local ones (where applicable).
If the code will be used/viewed by other people in the future, an efficient code will help them to use the program with ease rather than trying to understand a potentially messier code.
These are just some reasons that came to me off the top of my head, there could be more potential answers
a. True
b. False
Output: Your Goal
You will write a program to store a message in two variables, then print that message.
Part 1: Plan and Write the Pseudocode
Write an algorithm using pseudocode that someone else can follow. Choose one of the following options:
Decide on the message you would like to display to the screen. Some ideas include:
Your favorite book title or TV show and why you like it
A few sentences sharing information about you
Your favorite sport and team or athlete
Use two variables to store your message.
Insert your pseudocode here:
Part 2: Code the Program
Use the following guidelines to code your program.
Use the Python IDLE to write your program.
Using comments, type a heading that includes your name, today’s date, and a short description.
Set up your def main(): statement. (Don’t forget the parentheses and colon.)
Use at least two variables and two print statements to display your message to the screen.
Conclude the program with the main() statement.
Follow the Python style conventions regarding indentation in your program.
Run your program to ensure it is working properly. Fix any errors you may observe.
Example of expected output: The output below is an example of a “Favorite TV Show” message. Your specific results will vary depending on the choices you make about your message.
Output
My favorite TV show is MythBusters.
I like it because I learn a lot and they do crazy experiments.
When you've completed writing your program code, save your work by selecting 'Save' in the Python IDLE. When you submit your assignment, you will attach this Python file separately.
Part 3: Post Mortem Review (PMR)
Write two to three sentence responses to all the questions in the PMR chart.
Review Question
Response
What was the purpose of your program?
How could your program be useful in the real world?
What is a problem you ran into, and how did you fix it?
Describe one thing you would do differently the next time you write a program.
Part 4: Save Your Work
Don't forget to save this worksheet. You will submit it for your assessment.
Print | Save
Answer:
Pseudocode:
define func main
accept two parameters
create two variables from those parameters
v1 = title
v2=message
print v1, v2
returns None
call the func including the two arguments
Code:
def main(p1, p2):
""" this is a docstring, the function accepts two parameters p1 and p2 and prints them out"""
____title = p1
____message = p2
____print(title)
____print(message)
main()
Reminder
this didnot include the comment you are to add about your name, date and details
-- comments are placed after a pound sign (#)
also "____" the dashes behind the variables are not indentation just empasising them, as they are done with either by
NEVER MIX THEM CHOOSE AN INDENTATION STYLE AND STICK TO IT
Finally the call function doesn't have a colon called as a nomal object, just as the print funtion also you may include the dicstring if neccessary.
DONT FORGET THE REVIEW QUESTIONS
We need micro USB to USB 2.0 OR USB 3.O conversion data cable. Dylan has to purchase convertor data cable micro USB to USB 2.0 cable or cable micro USB to USB 3.0 cable.
Explanation:
Recently with micro USB data conversion, power connection also available, so that Dylan can charge and simultaneously can access the hard disk.
Before buying data cable following to be taken care.
1. Max access of hard disk capacity.
2. Data transactions speed also
3. Work mode or android and windows operating system.
Dylan has to purchase data conversion cable to access the hard disk.
Answer:
Treemap(option C) would be a good choice.
Explanation:
Treemaps are particularly useful for visualizing hierarchical data and displaying the distribution of categories within a dataset. Each category can be represented by a rectangular area, and the size of the rectangle can be proportional to the number of businesses in that category, making it easy to compare the categories' relative sizes.
A scatter plot (option A) and a line chart (option B) are typically used to visualize the relationship between two numerical variables and are not well-suited for displaying hierarchical or categorical data.
A choropleth map (option D) is used to represent geographical data on a map, where areas are shaded or colored based on a specific variable. It's not the most suitable choice for displaying the relative size of categories within a hierarchy, as it's primarily used for spatial data visualization.
A Treemap would be a good chart type for showing the relative size of each category (based on the number of businesses) in Yelp.
A Treemap would be a good chart type for showing the relative size of each category (based on the number of businesses) in Yelp.
A Treemap is a hierarchical chart that uses nested rectangles to represent different categories and the size of each rectangle is proportional to the number of businesses in that category. This allows for a clear visualization of the relative sizes of each category.
For example, if the 'Restaurant' category has a larger rectangle compared to the 'Retail' category, it indicates that there are more businesses in the 'Restaurant' category.
#SPJ11