Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Example 1: Define a function that takes an argument. Call the function. Identify what code is the argument and what code is the parameter.

Example 2: Call your function from Example 1 three times with different kinds of arguments: a value, a variable, and an expression. Identify which kind of argument is which.

Example 3: Create a function with a local variable. Show what happens when you try to use that variable outside the function. Explain the results.

Example 4: Create a function that takes an argument. Give the function parameter a unique name. Show what happens when you try to use that parameter name outside the function. Explain the results.

Example 5: Show what happens when a variable defined outside a function has the same name as a local variable inside a function. Explain what happens to the value of each variable as the program runs.
In this assignment, you will draw a student schedule by using a while loop.

You will ask the user for their first and last names, and then a list of their classes and room numbers. The loop should stop when the user enters STOP for their next class.

The schedule should print in the same format as the sample below. Some tips for formatting are:

Use spaces, not tabs, when printing the lines that contain only two asterisks to ensure that it is aligned with the lines containing nothing but asterisks.
Use tabs, not spaces, between certain items to help align the strings and variables as shown in the sample. You should end up with 3 tabs on each of these lines.
Create a code that plots 1000 random points each with their own random color on a user interface
Write a program that uses an initializer list to store the following set of numbers in an array named nums. Then, print the array.

14 36 31 -2 11 -6

Sample Run
[14, 36, 31, -2, 11, -6]
Use the function written in the last lesson to calculate a student’s GPA. Ask them how many classes they are taking, then ask them to enter the grades for each class and if it is weighted.

Your program should then output the averaged GPA including the decimal place.

Your main program must call the function.
please i need your help how did you come up with the answer and on how to code it please
Using the string methods from Unit 7, write a program that asks the user to enter two words, change them to upper case, then prints them in alphabetical order
Where is the part of this code that flips the columns and how do I replace it with logic that flips rows instead?


def flipIt(array):
for i in range(len(array)):
length = len(array[i])
for j in range(length // 2):
temp = array[i][j]
array[i][j] = array[i][length - 1 - j]
array[i][length - 1 - j] = temp


#testing

pic = [['@', ' ', ' ', ' ', ' ', '@'],
['@', '@', ' ', ' ', ' ', '@'],
['@', ' ', '@', ' ', ' ', '@'],
['@', ' ', ' ', '@', ' ', '@'],
['@', ' ', ' ', ' ', '@', '@'],
['@', ' ', ' ', ' ', ' ', '@']]


flipIt(pic)
for i in pic:
for j in i:
print(j,end=' ')
print()
Modify the code from the last problem by adding new lines of code. Your new program should swap the first and third elements of the nums array.

Print the nums array before and after the swap.
Modify the code from the last problem by adding new lines of code. Your new program should swap the first and third elements of the nums array.

Print the nums array before and after the swap.
LATEST TUTORIALS
APPROVED BY CLIENTS