Description : Why are local variable names beginning with an underscore discouraged? a) they are used to indicate a private variables of a class b) they confuse the interpreter c) they are used to indicate global variables d) they slow down execution
Last Answer : Answer: a Explanation: As Python has no concept of private variables, leading underscores are used to indicate variables that must not be accessed from outside the class.
Description : What is the maximum possible length of an identifier? a) 31 characters b) 63 characters c) 79 characters d) none of the mentioned
Last Answer : C
Description : Write a Python statement for assigning a string have a good day to a variable good -Python
Last Answer : good = "have a good day" Here good is the variable name and have a good day is a value in string (text)
Description : How to write python statement for assigning a value 55.5 to a variable maths -Python
Last Answer : variable name = "maths" value = "55.5" maths = 55.5
Description : All keywords in Python are in _________ a) lower case b) UPPER CASE c) Capitalized d) None of the mentioned
Last Answer : Answer: d Explanation: True, False and None are capitalized while the others are in lower case.
Description : Is Python case sensitive when dealing with identifiers? a) yes b) no c) machine dependent d) none of the mentioned
Last Answer : Answer: a Explanation: Case is always significant.
Description : What will be the output of the following Python code? >>> a={5,4}>>> b={1,2,4,5}>>> a
Last Answer : Answer: b Explanation: a
Description : What will be the output of the following Python code snippet? d1 = {"john":40, "peter":45} d2 = {"john":466, "peter":45} d1 > d2 a) True b) False c) Error d) None
Last Answer : Answer: c Explanation: Arithmetic > operator cannot be used with dictionaries.
Description : What will be the output of the following Python code snippet? d1 = {"john":40, "peter":45} d2 = {"john":466, "peter":45} d1 == d2 a) True b) False c) None d) Error
Last Answer : Answer: b Explanation: If d2 was initialized as d2 = d1 the answer would be true.
Description : What will be the output of the following Python code snippet? d = {"john":40, "peter":45} "john" in d a) True b) False c) None d) Error
Last Answer : Answer: a Explanation: In can be used to check if the key is int dictionary.
Description : What is the take away from this python, and ventilation system related story?
Last Answer : answer:I am suspicious of the story until the autopsy results are available. Snakes don't tend to catch and release - I'm surprised it didn't ingest the child. Snakes ... ineffective. Regulations allow the control and monitoring of populations, and hopefully fewer underground/illegal ownership.
Description : What's more powerful, JavaScript or Python?
Last Answer : Python is server side. You use python to output HTML/CSS/Javascript that the browser interprets. Your browser doesn’t know what Python is.
Description : What are the differences between Perl, PHP, and Python?
Last Answer : Um, i unfortunately cannot answer this question, but I have to ask: why the NSFW tag?
Description : What is the best platform for buildinga socail site; Python, ROR, or ASP.Net?
Last Answer : I would probably go with Django if you are down with Python. I hate RoR with a passion. Have you looked at any of the PHP based MVC frameworks? I’m fond of CakePHP myself. And I know lots of people like to hate on PHP, but it is fast and it works.
Description : So why are there so few web hosting services that offer Python support?
Last Answer : Virtual hosting and colocated hosting are so cheap now that shared-server web hosting services have to cut back on services. So shared-server web hosts focus on the features that the cheapskates of the ... -rate shared-server web hosts, but you'll actually be able to install the software you need.
Description : Is the Python Imaging Library not available on PyPI, or am I missing something?
Last Answer : Hm, forcing it to find-links seems to be working: easy_install -f http://www.pythonware.com/products/pil/ Imaging Got a heap of warnings along the way though. I’ll see how it turns out.
Description : How to write a Python program (i)to calculate area of a circle and (ii)to find if a given number is even or odd. -Python
Last Answer : (i) # 1.Circle pi = 3.14 r = int(input("Please enter the Radius of the circle:")) area = pi*r*r print("Area of the circle is" + str(area) + "sq ms") (ii) # 2. Odd Number & Even Number Number = int( ... Number % 2 == 0): print("This is an Even Number") else: print("It's an Odd Number")
Description : List out the different operators used in Python. What is the difference between operant’s and operators explain with example. -Python
Last Answer : Python divides the operators in the following groups: Arithmetic operators Assignment operators Comparison operators Logical operators Identity operators Membership operators Bitwise operators For students of class 9th : Arithmetic operators Assignment ... the right x >= y = x >>= 5 x = x >> 5
Description : What is a program ? -Python
Last Answer : Program is a set of instructions to perform a specific task using any programming language.
Description : how to run a python program in visual studio ? -Python
Last Answer : By creating a file It's simple to run anyfilename.py with Python. Just click the Run Python File in Terminal play button in the top-right side of the editor. Your program will start executing. ... Run Selection/Line in Python Terminal. This command is convenient for testing just a part of a file
Description : How can we execute Python Programs in Windows 10? -Python
Last Answer : If you have made an python program or u want to make it and execute it the you can do it by various methods : 1) With an IDE : => What is IDE IDE, or Integrated Development Environment, is a software ... into the python shell ... you can start typing your code .... try to type print("Hello World!")
Description : What is Python?
Last Answer : Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Python's elegant syntax ... an ideal language for scripting and rapid application development in many areas on most platforms.
Description : What will be the output of the following Python code? >>> a={4,5,6}>>> b={2,8,6}>>> a+b a) {4,5,6,2,8} b) {4,5,6,2,8,6} c) Error as unsupported operand type for sets d) Error as the duplicate item 6 is present in both sets
Last Answer : Answer: c Explanation: Execute in python shell to verify.
Description : What will be the output of the following Python code? nums = set([1,1,2,3,3,3,4,4])print(len(nums)) a) 7 b) Error, invalid syntax for formation of set c) 4 d) 8
Last Answer : Answer: c Explanation: A set doesn’t have duplicate items.
Description : What will be the output of the following Python code? >>>t = (1, 2) >>>2 * t a) (1, 2, 1, 2) b) [1, 2, 1, 2] c) (1, 1, 2, 2) d) [1, 1, 2, 2]
Last Answer : Answer: a Explanation: * operator concatenates tuple.
Description : What will be the output of the following Python code? d = {"john":40, "peter":45} d["john"] a) 40 b) 45 c) “john” d) “peter”
Last Answer : Answer: a Explanation: Execute in the shell to verify.
Description : What will be the output of the following Python code? >>>t = (1, 2, 4, 3, 8, 9) >>>[t[i] for i in range(0, len(t), 2)] a) [2, 3, 9] b) [1, 2, 4, 3, 8, 9] c) [1, 4, 8] d) (1, 4, 8)
Last Answer : Answer: c Explanation: Execute in the shell to verify.
Description : What will be the output of the following Python code? >>>t=(1,2,4,3) >>>t[1:-1] a) (1, 2) b) (1, 2, 4) c) (2, 4) d) (2, 4, 3)
Last Answer : Answer will be (2,)
Description : What will be the output of the following Python code? >>>t=(1,2,4,3) >>>t[1:3] a) (1, 2) b) (1, 2, 4) c) (2, 4) d) (2, 4, 3)
Last Answer : Answer: c Explanation: Slicing in tuples takes place just as it does in strings.
Description : Which of the following is a Python tuple? a) [1, 2, 3] b) (1, 2, 3) c) {1, 2, 3} d) {}
Last Answer : Answer: b Explanation: Tuples are represented with round brackets.
Description : What will be the output of the following Python code snippet? d = {"john":40, "peter":45} a) “john”, 40, 45, and “peter” b) “john” and “peter” c) 40 and 45 d) d = (40:”john”, 45:”peter”)
Last Answer : Answer: b Explanation: Dictionaries appear in the form of keys and values.
Description : Which of the following cannot be a variable? a) __init__ b) in c) it d) on
Last Answer : (b) "in" cannot be a variable. In programming, a variable is a symbolic name given to a value or an expression that can change at runtime. The value assigned to a variable can be ... also reserved keywords or common variable names in some programming languages and may not be used as variable names.
Description : Which of the following is an invalid variable? a) my_string_1 b) 1st_string c) foo d) _
Last Answer : Answer: b Explanation: Variable names should not start with a number
Description : Which of the following statements create a dictionary? a) d = {} b) d = {“john”:40, “peter”:45} c) d = {40:”john”, 45:”peter”} d) All of the mentioned
Last Answer : A
Description : What is the result of round(0.5) – round(-0.5)? a) 1.0 b) 2.0 c) 0.0 d) None of the mentioned
Last Answer : Answer: b Explanation: Python rounds off numbers away from 0 when the number to be rounded off is exactly halfway through. round(0.5) is 1 and round(-0.5) is -1.
Description : Which of the following is invalid? a) _a = 1 b) __a = 1 c) __str__ = 1 d) none of the mentioned
Last Answer : c) str = 1 In Python, __str__ is a special method that is used to define how an object should be represented as a string. It is a predefined method in Python and cannot be used as a ... those starting with __ are considered protected. They are valid names but have some specific uses in the code.
Description : Names in XML document must start either with a letter, number or underscore. -Technology
Last Answer : False Names in XML must start either with a letter or underscore character.
Description : Which of these about a set is not true? a) Mutable data type b) Allows duplicate values c) Data type with unordered values d) Immutable data type
Last Answer : Answer: d Explanation: A set is a mutable data type with non-duplicate, unordered values, providing the usual mathematical set operations.
Description : What is the result of cmp(3, 1)? a) 1 b) 0 c) True d) False
Last Answer : Answer: a Explanation: cmp(x, y) returns 1 if x > y, 0 if x == y and -1 if x < y
Description : What is the output of print 0.1 + 0.2 == 0.3? a) True b) False c) Machine dependent d) Error
Last Answer : Answer: b Explanation: Neither of 0.1, 0.2 and 0.3 can be represented accurately in binary. The round off errors from 0.1 and 0.2 accumulate and hence there is a difference of 5.5511e-17 between (0.1 + 0.2) and 0.3.
Description : In XML, tag names cannot contain spaces but can uses underscores. -Technology
Last Answer : True Tag name must start either with a letter or underscore (_) character.
Description : Where can I find a cross between a resume and a character sheet?
Last Answer : A curriculum vitae is what you want.
Description : More Rails Devs/jobs than Django?
Last Answer : Rails was opensourced about a year before Django and it had good marketing. There were all kinds of videos of “create a blog in under X minutes,” DHH was preaching the gospel of Ruby, etc. Ruby vs. Python, Rails vs. Django comes down to your own programming style and preferences.
Description : Django or Rails?
Last Answer : In the grand scheme of things, both Django and Rails are pretty equivalent—My suggestion is let the language you want to use determine things (and give Ruby a try if you haven’t played with it much but you have with Python).
Description : What are the advantages and disadvantages of various web site development and hosting software?
Last Answer : On my personal computer I use xampp: apache, php, mysql On servers I use: apache, php, mysql. I would recommend mysql over mssql. As for your question about what works better with each other I would assume they all work together fine, but I could be wrong, since I don’t use java or python.
Description : How do I get an RSS feed for Twitter without a user/password required?
Last Answer : Actually, that looks like javascript and this might help if you haven’t figured it out already. Also this
Description : Should I learn PyObjC or just dive right into Objective C?
Last Answer : Nerd. :)
Description : Looking for a unit-testing framework that can work with AppEngine projects?
Last Answer : The folks at Google wrote their examples in JUnit: http://code.google.com/appengine/docs/java/tools/localunittesting.html. As a big fan of the xUnit frameworks, I’d consider that a stroke of good luck.
Description : What is the easiest and fastest way/language/tool I can use to build high quality animated web content and web apps.?
Last Answer : You can do a lot with jQuery. For example.
Description : How has the experience of developing Ask-public.com been with regards to the software used?
Last Answer : At the top of ask-public’s main page, there is a contact button, ask the two creators of this site how they did it & what problems they ran into. Since they were the ones to create it, none of us made ask-public.