Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

46 84.8 K/s 8 (29/244) EB... token: One of the basic elements of the syntactic structure of a program, analogous to a word in

46 84.8 K/s 8  (29/244) EB... token: One of the basic elements of the syntactic structure of a program,

46 84.8 K/s 8 (29/244) EB... token: One of the basic elements of the syntactic structure of a program, analogous to a word in a natural language. syntax: The rules that govern the structure of a program. parse: To examine a program and analyze the syntactic structure. bug: An error in a program. debugging: The process of finding and correcting bugs. 1.9 Exercises Exercise 1.1. It is a good idea to read this book in front of a computer so you can try out the examples as you go. Whenever you are experimenting with a new feature, you should try to make mistakes. For example, in the "Hello, world!" program, what happens if you leave out one of the quotation marks? What if you leave out both? What if you spell print wrong? This kind of experiment helps you remember what you read; it also helps when you are programming, because you get to know what the error messages mean. It is better to make mistakes now and on purpose than later and accidentally. 1. In a print statement, what happens if you leave out one of the parentheses, or both? 2. If you are trying to print a string, what happens if you leave out one of the quotation marks, or both? 36 1 9:46 3. You can use a minus sign to make a negative number like -2. What happens if you put a plus sign before a number? What about 2++2? Chapter 1. The way of the program 4. In math notation, leading zeros are ok, as in 09. What happens if you try this in Python? What about 011? 5. What happens if you have two values with no operator between them? Exercise 1.2. Start the Python interpreter and use it as a calculator. 1. How many seconds are there in 42 minutes 42 seconds? 2. How many miles are there in 10 kilometers? Hint: there are 1.61 kilometers in a mile. 3. If you run a 10 kilometer race in 42 minutes 42 seconds, what is your average pace (time per mile in minutes and seconds)? What is your average speed in miles per hour? A O U : X

Step by Step Solution

3.33 Rating (135 Votes )

There are 3 Steps involved in it

Step: 1

1 In a print statement if you leave out one of the parentheses Python will give you a syntax error F... blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Macroeconomics

Authors: David Colander

8th edition

978-0078004407, 78004403, 978-0077247171, 77247175, 978-0077307110

More Books

Students also viewed these Programming questions