![]() DeepLearning.AI Data Science and Machine Learning: Deep Learning Specialization.IBM Python Data Science: Visualizing Data with Python.Harvard University Computer Science Courses: Using Python for Research.Harvard University Learning Python for Data Science: Introduction to Data Science with Python.IBM Data Engineering Fundamentals: Python Basics for Data Science.IBM Data Science: Professional Certificate in Python Data Science.Google Data Analysis: Professional Certificate in Data Analytics.IBM Data Analysis: Professional Certificate in Data Analytics.IBM Data Science: Professional Certificate in Data Science.UC Davis Data Science: Learn SQL Basics for Data Science.Standford University Data Science: Introduction to Machine Learning.Harvard University Data Science: Learn R Basics for Data Science.Write a line of Python code that prompts the user for the name of their favorite ice cream and stores it in a valid variable name.□ Discover Online Data Science Courses & Programs (Enroll for Free) Provide an example of a numeric literal.Ĥ. Provide an example of a string literal.ģ. State a good variable name for an employee’s ID number.Ģ. Change the \n to \t and describe what happens to the program output.Īpplication Questions: Use the Thonny IDE to check your workġ. The \n is a "string literal escape sequence" in python. State what is displayed on the screen when you executed the program.ī. Print(name + "'s ID is" + ID + "\nand is enrolled in " + course)Ī. ID= input( "Enter your student ID number: ")Ĭourse = input( "Enter your course number: ") Execute the following program: name = input( "Enter name:") ![]() Why does the last print statement crash the program? What would you do to correct it?ġ0. Notice that some statements include a comma (,) between the two literals being printed and some statements use a "+". What is the difference between the first two print statements? Does the difference affect the output?Ĭ. State the output for each of line of code.ī. Are the following variable names valid? Are they good names? Why or why not? Variable nameĪ. What are the rules for creating a valid variable name?ħ. Then examine the following lines of valid code. In 5d did you notice how the word from (like printand input above) became purple? In Thonny (it is a function), so if you are typing a word and it turns purple, that word is a function, and you can't use it as a variable name. Examine the errors that occurred when executing the lines of code in question 5. your name = input("What is your name?")Ĭ. The idea here is to figure out how a variable name can be written (there are rules for naming variables and you need to try and figure out some of the basic ones, so try each of these in turn)ī. Hint, edit the above code, don't rewrite from scratch. What happens when you execute each of the following lines of Python code? Print("Your name is",name) name = input( "What is your name? ")ĥ. ![]() What appears in the console window when this line of code is executed? What happens when this line of code is executed?ī. Examine the first line of Python program: name = input(" What is your name? " )Ī. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |