Answer:
- equation = input("Enter an equation: ")
-
- if("+" in equation):
- operands = equation.split("+")
- result = int(operands [0]) + int(operands[1])
- print(operands[0] + "+" + operands[1] + "=" + str(result))
- elif("-" in equation):
- operands = equation.split("-")
- result= int(operands [0]) - int(operands[1])
- print(operands[0] + "-" + operands[1] + "=" + str(result))
- elif("*" in equation):
- operands = equation.split("*")
- result = int(operands [0]) * int(operands[1])
- print(operands[0] + "*" + operands[1] + "=" + str(result))
- elif("/" in equation):
- operands = equation.split("/")
- result = int(operands [0]) / int(operands[1])
- print(operands[0] + "/" + operands[1] + "=" + str(result))
- elif("%" in equation):
- operands = equation.split("%")
- result = int(operands [0]) % int(operands[1])
- print(operands[0] + "%" + operands[1] + "=" + str(result))
Explanation:
The solution code is written in Python 3.
Firstly prompt user to enter an equation using input function (Line 1).
Create if-else if statements to check if operator "+", "-", "*", "/" and "%" exist in the input equation. If "+" is found (Line 3), use split method to get the individual operands from the equation by using "+" as separator (Line 5). Output the equation as required by the question using string concatenation method (Line 6). The similar process is repeated for the rest of else if blocks (Line 7 - 22).
Answer:
Attached is a screenshot of my code for 'PasswordGenerator' and the tests necessary.
Explanation:
If you need any explanation, please ask!
A web designer/developer is responsible for the design, layout and coding of a website. They are involved with the technical and graphical aspects of a website and how the site works and how it looks.
Explanation:
- A content writer/editor creates and revises the text that visitors read when the visit a website, choose a link, image, video, or other media that enhances your text content.
- A web artists/graphic designer's responsibility is to create original art, such as logos, stylized typefaces, and avatars, and props for virtual 3-d worlds.
- A web designer's role is to create webpages that combine, text, images, and links using tools such as markup languages; CCS, HTML, and WYSIWYG editors.
- Web programmer/database developer's job is to script languages such as, JavaScript, ASP, PHP, and MYSQL and must plan, create, secure, and maintain databases of varying complexity.
- Web Administrator assumes all roles, including creative, high-tech, and oversight. May oversee a web development team that includes technical and creative roles.