Posts

Welcome to Python! The three major versions of Python are 1.x, 2.x and 3.x. These are subdivided into minor versions, such as 2.7 and 3.3. Code written for Python 3.x is guaranteed to work in all future versions. Both Python Version 2.x and 3.x are used currently. This course covers  Python 3.x , but it isn't hard to change from one version to another. Python has several different implementations, written in various languages. The version used in this course,  CPython , is the most popular by far. An  interpreter   is a program that runs scripts written in an interpreted language such as Python. Welcome to Python! Python  is a high-level programming language, with applications in numerous areas, including web programming, scripting, scientific computing, and artificial intelligence. It is very popular and used by organizations such as Google, NASA, the CIA, and Disney. Python is processed at runtime by the  interpreter . There is no need to com...
Assiggnment 2.3: 2.3  Write a program to prompt the user for hours and rate per hour using input to compute gross pay. Use 35 hours and a rate of 2.75 per hour to test the program (the pay should be 96.25). You should use  input  to read a string and  float()  to convert the string to a number. Do not worry about error checking or bad user data. Answers: # This first line is provided for you hrs = float(input("Enter Hours:")) rate = float(input("Enter rate per hour:")) result=hrs*rate print("Pay: "+str(result)) Input: Enter hours 35 Enter rate  2.75 Output:  pay 96.25 Here is the link: https://www.py4e.com/tools/pythonauto/?PHPSESSID=f1d224f157347bc1c56913b098f5cd2f
Assignment 2.2: 2.2  Write a program that uses  input  to prompt a user for their name and then welcomes them. Note that  input  will pop up a dialog box. Enter  Sarah  in the pop-up box when you are prompted so your output will match the desired output. Answer: # The code below almost works name = input("Enter your name") print("Hello"+" "+name) input: Sarah output: Hello Sarah Here is the link: https://www.py4e.com/tools/pythonauto/?PHPSESSID=b59178881b02435bc1b57d8bd385ca95
Quiz 2 answers : 1. A constant 2. 123abc 3. 23spam 4. iterate 5. retrieve the current value of x add two to it 6. parentheses() 7.  2 8. 5.0 9. 98 10. pause the program and read data from user. here is the link of those questions https://www.coursera.org/learn/python/exam/TlsQ7/chapter-2/attempt
Answers:   1. what python statement would you like me to run? 2. 20 3. .py 4. while 5. quit() 6. CPU 7. A sequence of instructions 8. secondary memory 9. the computer did not understand the statements 10. random steps here is the link  https://www.coursera.org/learn/python/exam/WiLXL/chapter-1/attempt
Image
Here I am trying to store some basic python programming techniques which will help me to build a model in future!! After installing python 2 or python 3 everyone try to check their python command shell by writing a simple code.. Here it is, print "hello world!" --for python 2 print("hello world") -- for python 3  or we can write print('hello world') To indicate a string in python programming we can use both "" or ' ' .