Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 2 Please give an example of the following function in Python. The function is named fred and takes two numbers as parameters. The function

Question 2

Please give an example of the following function in Python. The function is named fred and takes two numbers as parameters. The function adds the two numbers together then prints the sum.

Question 3

What happens if you mix spaces and tabs when entering your Python source code?

Question 4

Given the following list:

tokens = [ 'wind', 'rain', 'lightning' ]

Please write a loop to print out all the list elements

tokens = [ 'wind', 'rain', 'lightning' ]

for i in range (len (tokens)):

print("{}.{}".format(i + 1, tokens[i]))

Question 5

Please write an if/else statement that prints Cat 5 if variable wind_speed is greater than 150, and Gentle Breeze otherwise.

Question 6

Please write a snippet of Python code that concatenates the strings Hello and World with a space between them and assigns the result to variable traditional_program.

Question 7

Please write a snippet of Python code to split this string: first,second,third,last into a list of tokens, using the comma (,) as a delimiter.

Question 8

What python statement is used to make a module available for use in your Python code?

Your Answer:

Question 9

What python Boolean operator would you use to ensure that both of the following are true?

var1 > 5

var1 < 10

Question 10

Please write a Python statement that prompts the user for his or her age, and then assigns the result to the variable named client_age.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Students also viewed these Databases questions