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...
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...
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...
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...
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.
(20 pts) Using your programming language of choice (from C++, Java, or Python) , also drawing...
(20 pts) Using your programming language of choice (from C++, Java, or Python) , also drawing on your experience from program 1, read an integer, n from keyboard (standard input). This integer represents the number of integers under consideration. After reading that initial integer in, read n integers in, and print the minimum and maximum of all the integers that are read in. Example: Input Output 7 1 5 3 6 9 22 2 Min: 1 Max: 22 C++ preferred
Design a Python example that includes the following Basic concepts: Loops Conditional statements two of the...
Design a Python example that includes the following Basic concepts: Loops Conditional statements two of the advanced concepts: Encryption / Decryption, Lists / Dictionaries Please leave a Description of the program
2.7 Explaining basic networking concepts Basics of network communication Device addresses Basic protocols 2.8 Scenario to...
2.7 Explaining basic networking concepts Basics of network communication Device addresses Basic protocols 2.8 Scenario to install, configure and secure a basic wireless network Best Practices 3.1 Explaining the purpose of operating systems The interface between applications and hardware Disk management Process management/scheduling Application management Memory management Device management Access control/protection
Programming language in Python Suppose, for Jane, n1 = 3, n2 = 4, and n3 =...
Programming language in Python Suppose, for Jane, n1 = 3, n2 = 4, and n3 = 5. Also suppose, Jane iterates the number from 1 to 15. At the beginning, Jane sets count to 0, and then proceeds iterating the number from 1 to 15 and for each iteration does the following: for 1, count is increased by 1 because it is not divisible by 3, 4, and 5; count is now: 1 for 2, count is increased by 2...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT