Question

In: Computer Science

a summary explaining the basic understanding of the following programming concepts using a language of python:...

a summary explaining the basic understanding of the following programming concepts using a language of python:
•Variables
•Arithmetic and Logical operations
•Sequential coding (Structured programming
•Decision structure (If statements)
•Repetition structure
•Functions
with some coding demos inside visual studio code python IDE which can be sent as screenshot. preferably a typed summary please which can be written into powerpoint pleaseeeee ???

Solutions

Expert Solution

Variables are used as containers for storing data values.

Unlike other programming languages, Python has no specific command for declaring a variable.

In Python A variable is created the moment you first assign a value to it.

Example:----- x = 5
y = "John"
print(x)
print(y)

Variables do not need to be declared with any particular type, and can even change type after they have been set.

x = 4 # x is of type int
x = "Sally" # x is now of type str
print(x)

Arithmetic and Logical operations:----

Arithmetic operators are used with numeric values to perform common mathematical operations

Operator Name Example

+   Addition a+b

-   Subtraction a-b

* Multiplication a*b

/ Division a/b

%   Modulus a%b

Sequential coding (Structured programming):------

Structured programming is a program written with only the three constructions sequence, decision (if..elif statements), and repetition (while or for statements).

Important: the body of a Python if, elif, while, or for statement is indicated by indenting four spaces. Python does not use end statements.

Example:

x = 56
y = 11
z = x + y
print(z)

Decision structure (If statements):-------

if statement is the most simple decision making statement. It is used to decide whether a certain statement or block of statements will be executed or not i.e if a certain condition is true then a block of statement is executed otherwise not.

Here, condition after evaluation will be either true or false. if statement accepts boolean values – if the value is true then it will execute the block of statements below it otherwise not. We can use condition with bracket ‘(‘ ‘)’ also.

As we know, python uses indentation to identify a block. So the block under an if statement will be identified as shown in the below example:

i = 20;

if (i < 15):

    print ("i is smaller than 15")

    print ("i'm in if Block")

else:

    print ("i is greater than 15")

    print ("i'm in else Block")

print ("i'm not in if and not in else Block")

Repetition structure:------

  • Repetition statements are called loops, and are used to repeat the same code multiple times in succession.
  • Python has two types of loops: Condition-Controlled and Count-Controlled
  • Condition-Controlled loop uses a true/false condition to control the number of times that it repeats - while. Basic syntax:
  • While condition:
      statement(s) # notice the indent from of this line relative to the while
  •  
    Functions:------
  • A function is a block of code which only runs when it is called.

  • You can pass data, known as parameters, into a function.

  • A function can return data as a result.

  • In Python a function is defined using the def keyword:

  • def my_function():
      print("Hello from a function")

-------I Hope This Will Help You------

--------Plese Give Me Positive Rating------Thank You----------


Related Solutions

Integer Pointers Program and Analysis Demonstrate an understanding of basic C++ programming concepts by completing the...
Integer Pointers Program and Analysis Demonstrate an understanding of basic C++ programming concepts by completing the following: Program: Create a C++ program that asks the user to enter three integer values as input. Store the values into three different variables. For each variable, create three integer pointers that point to each value. Display the contents of the variables and pointers. In your program, be sure to use the new operator and delete operators to management memory. Program Analysis: Given your...
String Input Console Application and Program Analysis Demonstrate an understanding of basic C++ programming concepts by...
String Input Console Application and Program Analysis Demonstrate an understanding of basic C++ programming concepts by completing the following: Program: Create a simple C++ console application that will write a program that will take string input from a user. Your program should reverse the string and then print the output to the screen. Take input from the user 3 times for varying string lengths. Program Analysis: Given your program implementation, discuss and identify the possible vulnerabilities that may exist. If...
Book - Introduction to Programming Using Visual Basic 11th Edition by David I. Schneider Programming Language...
Book - Introduction to Programming Using Visual Basic 11th Edition by David I. Schneider Programming Language - Visual Studio 2017 RESTAURANT MENU Write a program to place an order from the restaurant menu in Table 4.13. Use the form in Fig. 4.70, and write the program so that each group box is invisible and becomes visible only when its corresponding check box is checked. After the button is clicked, the cost of the meal should be calculated. (NOTE: The Checked...
Implement Radix Sort using PYTHON programming language. Use one of the two options for the algorithm...
Implement Radix Sort using PYTHON programming language. Use one of the two options for the algorithm to sort the digits: Use Counting Sort or Bucket Sort. • Assume the numbers are maximum 4-digit numbers. • If using Counting Sort, you can see that your digit range is between 0 and 9 ([0…9]). • If using Bucket Sort, you will have ten buckets labeled from 0 to 9. Please add comments and explain every step carefully.
Using Python programming language, write a LONG piece of code that utilizes the do while function...
Using Python programming language, write a LONG piece of code that utilizes the do while function and the switch statement, please do not make It short, thank you.
Write a summary of your understanding of the following Quality Concepts (one half page for each...
Write a summary of your understanding of the following Quality Concepts (one half page for each concept): (1) Continuous Process Improvement, (2) Kaizen, (3) ECRS Method, (4) Performance Measurements, and (5) Benchmarking.
Write a summary of your understanding of the following Quality Concepts (one half page for each...
Write a summary of your understanding of the following Quality Concepts (one half page for each concept): (1) Leadership, (2) Customers Satisfaction, (3) Customers Delight, (4) Employee Involvement
Create a basic program (C programming language) that accomplishes the following requirements: Allows the user to...
Create a basic program (C programming language) that accomplishes the following requirements: Allows the user to input 2 numbers, a starting number x and ending number y Implements a while loop that counts from x (start) to y(end). Inside the loop, print to the screen the current number Print rather the current number is even or odd If the number is even , multiply by the number by 3 and print the results to the screen. If the number is...
The programming language is Python Instructions: Create a function that will delete a node in a...
The programming language is Python Instructions: Create a function that will delete a node in a Linked List based on position number. On below example, if you want to delete position #2, it will remove the Banana (arrangement of nodes below is Apple, Banana, Cherry, Grapes, Orange). myLinkedList = LinkedList() myLinkedList.append("Banana") myLinkedList.append("Cherry") myLinkedList.append("Grapes") myLinkedList.append("Orange") myLinkedList.prepend("Apple") myLinkedList.deleteByPositionNum(2) node = myLinkedList.head while node: print(node.value, " ") node = node.next_node You may start with the function head: def deleteByPositionNum(self, positionNum):
Programming language Python It have to be in Functions with a main function Samuel is a...
Programming language Python It have to be in Functions with a main function Samuel is a math teacher at Hogwarts School of Witchcraft and Wizardry. He loves to give his students multiplication exercises. However, he doesn’t care about the actual operation result but the unit sum of its digits. At Hogwarts School of Witchcraft and Wizardry, they define the unit sum (US) of N as the unit that it is left after doing the sum of all the digits of...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT