Answer:
Explanation:
In the following examples, input and output are distinguished by the presence or absence of prompts (>>> and …): to repeat the example, you must type everything after the prompt, when the prompt appears; lines that do not begin with a prompt are output from the interpreter. Note that a secondary prompt on a line by itself in an example means you must type a blank line; this is used to end a multi-line command.
Many of the examples in this manual, even those entered at the interactive prompt, include comments. Comments in Python start with the hash character, #, and extend to the end of the physical line. A comment may appear at the start of a line or following whitespace or code, but not within a string literal. A hash character within a string literal is just a hash character. Since comments are to clarify code and are not interpreted by Python, they may be omitted when typing in examples.
There are 4 strings within the best_list. Strings can be easily identified becuase they're surrounded with quotes. For example, "hello" is a string because it has the quotes around it.
KAPWING Video Editing Software allows you to use existing You Tube Videos in your design.
Answer:
Yea it should, it depends are you using a phone or a PC? because most of the time internally built in editing software on computers is better.
7.5 Code practice Plz answer ASAP
def calculate_GPA(grade, weight):
grades = {"A": 4, "B": 3, "C": 2, "D": 1, "F": 0}
if weight == 0:
return grades[grade]
else:
return grades[grade] + 1
classes = int(input("How many Classes are you taking? "))
total = 0
for x in range(classes):
letter = input("Enter your Letter Grade: ")
user_weight = int(input("Is it weighted? (1 = yes) "))
grade = calculate_GPA(letter, user_weight)
total += grade
print("Your GPA score is: ", grade)
print("Your weighted GPA is a",(total/classes))
I wrote my code in python 3.8. I was able to replicate the output in your picture exactly. If you need me to make any changes, I'll do my best.
The function is an illustration of for loops
For loops are used to perform repetitive operations; just like the while loop
The program in Python, where comments are used to explain each line is as follows:
#This defines the studentGPA function
def studentGPA(grade, weight):
#This initializes a dictionary for all grades
allGrade = {"A": 4, "B": 3, "C": 2, "D": 1, "F": 0}
#This sets the return grade to 0
retValue = 0
#If the grade is valid
if grade in allGrade:
#If the weight is 0
if weight == 0:
#Then score is not graded
retValue = allGrade[grade]
#If otherwise
else:
#This adds 1 to the return grade
retValue = allGrade[grade]+1
#This returns the grade point
return retValue
#The main begins here
#This gets the number of classes
klass = int(input("How many Classes are you taking? "))
#This initializes the total grade to 0
total = 0
#This following is repeated for each class
for x in range(klass):
#This gets input for the letter grade
letterGrade = input("Enter your Letter Grade: ")
#This gets input for the weight
weight = int(input("Is it weighted? (1 = yes) "))
#This gets the corresponding grade
grade = studentGPA(letterGrade, weight)
#This prints the grade point
print("Your GPA score is: ", grade)
#This calculates the total grade
total += grade
#This calculates the GPA
GPA = total/klass
#This prints the GPA
print("Your weighted GPA is a",GPA)
Read more about for loop at:
https://brainly.com/question/12736327