Different data types on python?
There a couple data types.
String = Text | "hello"
Float = Decimal Value | 5.5
Integer = Whole number | 5
Boolean = True/False Statement | False
A database is a program that stores information. Such info can be sorted and retrieved in whatever output the operator requires. A common use for a database is to store the names and addresses of members belonging to a club, etc. The club Secretary or Treasurer can sort the membership database to show those member who have not yet renewed their membership subscription.
A commercial company may have a database showing customers' names, addresses and other details, their past purchases, their credit state, and so on.
What are the advantages and disadvantages of Visual Basic?
Visual basic is a proprietary programming language written by Microsoft, so programs written in Visual basic cannot, easily, be transferred to other operating systems. There are versions of Basic that run on several operating systems, but they aren't direct clones of VB so some work would have to be done. Visual Basic is built around the .NET environment used by all Microsoft Visual languages, so there is very little that can't be done in Visual Basic that can be done in other languages (such as C#). Visual Basic only really exists as a high-level Windows programming language - for writing Windows applications. Whereas other languages (particularly the "C" family of C, C++ and C#) have a life outside of Windows and are used for everything from writing device drivers or "embedded" systems up to large applications. There are some, fairly minor disadvantages compared with C: C has better declaration of arrays - its possible to initialise an array of structures in C at declaration time; this is impossible in VB. in combination if tests: if A and B then endif In C, it is defined that A is evaluated first, then B. Visual Basic doesn't guarantee the order of evaluation; this makes some programming a bit more awkward; in C, the following is safe: if Inst>0 and Array(inst) =5 then
{
// do stuff
} as the Inst>0 test is always done first, in visual basic it becomes: if Inst > 0
if Array(inst) = 5 then
' do stuff
endif
endif The advantages of VB are the ease of learning - the syntax is simpler than other languages (although it can be argued that C has more flexibility). The visual environment is excellent (although that's common to all the visual languages). It's widely used and, therefore, well understood.
How do you write the code by python?
it depends what type of program you wish to write. python is a very simple programing langauge therefore it doesnt have much room to play with. i mainly use it to work out simple math problems, or use it to calculate thing for games i play,
Ex.) This is a program i wrote to work out the Pythagorean therom to find side "C":
a = input("Enter Corner Side A\n ")
b = input("Enter Corner Side B\n ")
c = a*a+b*b
import math
print math.sqrt(c)
raw_input("Press <enter> To Leave Program")
input mean that's where you enter your variable, raw input is what you put at the end so it doesnt just run away (NOTE*** THIS IS A PYTHON 2.6.5 SCRIPT, IT WILL NOT WORK ON OTHER VERSIONS OF PYTHON"
notice i put ("Press <enter> To Leave Program") this is what it will say before it "runs away". i suggest watching some youtube videos on how to write programs for your version of python. also try using the manual that comes with your version of python. it helps greatly.
Programmers use pseudo-code to debug programs. Pseudo-code lays out the basic coding for the program before putting it into any specific programming language. That way, a programmer can be sure that all the necessary components are included, and that the program will run as expected.
How do functions help you to reuse code in a program?
Functions hold code, which means anything that happens within a function can be "called" later on. Allowing the programmer to save time, and ensuring he doesn't have to re-write code. Example:
Instead of writing "Hello" 10 times, I made a function that said print("hello") 5 times, then "Called" the function twice.
def helloFiveTimes():
print("Hello")
print("Hello")
print("Hello")
print("Hello")
print("Hello")
return
helloFiveTimes()
helloFiveTimes()
There are three forms of loop commonly used in C/C++, the for loop, the while loop
and the do-while loop.
The for loop is most commonly used whenever an action is going to be performed a set amount of times. For example, to sum every element in an array:
for(i = 0; i < arraySize; i++)
{
sum = sum + array[i];
}
The while loop and do-while loop are commonly used to loop until a condition is met. The difference between the two is that the do-while loop goes through one iteration before checking its condition, while the while loop checks its condition before any execution of the loop.
Example do-while loop:
do
{
randomNumber = rand() % 10;
}while(randomNumber != 6);
Example while loop:
cout > number;
while(number < 0)
{
cout > number;
}
What is the purpose of print strings in python?
It means that python will print(or write out) a value you input.
How do you make flowchart of ascending order using raptor?
Hey sunil i have an idea about mode that is more repeated data is mode ok
na
Example in the series 2,4,5,2,4,5,2,4,24,22,2,2,7,8,9,2 Mode for this data is 2 i.e. Answer is 2
How do you write a program in Python to find the first n prime numbers?
One way to do this is to write a function that checks if a number is prime:
def isPrime(number):
for i in range(2, number):
if number%i == 0:
return False
return True
Then create variables to track how many primes have been found and a variable to track which number is being tested for being prime. Increment that variable and test it, and if it is prime print it out (or save it somewhere) and increment the variable being used to track how many primes have been found:
targetPrimes = 10 #number of primes to find
primesFound = 0 #number of primes found
i = 1
while (primesFound < targetPrimes):
i += 1 #first number tested is 2
if isPrime(i):
print(i)
primesFound += 1
Write a program in c language to draw a diamond shaped if you give the number?
Hey, It is not the exact logic for a given program.
Here i m giving the code with minimum number of executing steps.
also i m sure that there doesn't exist any other way to print the same Diamond such that code executing steps will be less than mine.
It is not copied from any website, book etc.
#include
void main()
{
int n,i,s,k,flagReverce=0;
printf("Enter the no. of rows\n");
scanf("%d", &n);
for (i=1; i>=1; i++)
{
for (s=n; s>i; s-)
printf(" ");
for(k=1; k<(i*2)-1; k++)
printf("*")
printf("\n")
if (i == n)
flagReverce = 1
if (flagReverce = 1)
i-=2
}
}
Python is an interpreted, high-level and general-purpose programming language. Python's design philosophy emphasizes code readability with its notable use of significant indentation. Its language constructs and object-oriented approach aim to help programmers write clear, logical code for small and large-scale projects.[29]
Python is dynamically-typed and garbage-collected. It supports multiple programming paradigms, including structured (particularly, procedural), object-oriented and functional programming. Python is often described as a "batteries included" language due to its comprehensive standard library.
What is the Python programming language?
In the context of computer programming, Python is an open source programming language.
I put some links that I found helpful when learning Python on my webpage:
http://www.homeworkcat.com
What are some features of the python programming language?
Here are some of the features I like:
I want to add more info, like
Versatile
Flexible
Cross-platform and Open Source
Also as of March 2016, Python had the highest year-on-year job demand growth (at 19%) among all programming languages. On Angel List, Python stands as the 2nd most demanded skill and also the skill with the highest average pay offered.
How do you do a while loop in python?
#LMGTFY
In this example, I have created an array of numbers called 'foobar', and while the variable 'sum' is less than 20, I will have the program continue to loop back and add the next number in the array sequence.
#!usr/bin/env
foobar = [1, 4, 7, 2, 9, 11, 0, 6, 5, 4, 16, 3]
sum = 0
iteration = 0
while(sum < 20):
sum += foobar[iteration]
iteration += 1
print("Finished!")
What does a Python Developer do?
The main aim of software developers are to create a website as per the user requirements and need. They create unique database whether for small or large companies. And Coordinate with owner for the website interface. If you are looking for good software developer, Dmitry Khodarenok is serving custom android application development since 7 years.
Where can one download a free Python tutorial?
The only place you can get a legitimate trial of the software Python is from Python's official site. Other downloads may contain virus or other malicious software.
How do you get input in python?
I get in put with input() function like this:
x = input("what do you want to ask")
What is the meaning of print python programming?
In Python; the "print" feature will simply output something (defined by you) onto the screen. For example: print("Hello") would output "Hello" to the screen!
What are the rules for naming variables in python?
A variable falls under the category of "Python identifier". SUch an identifier must start with a letter (uppercase or lowercase) or an underscore, followed by zero or more letters, underscores, and digits. Note that Python is case-sensitive; for example, myvariable, MyVariable, and MYVARIABLE would be treated as three different variables.
Sorry, I'm not doing your homework for you.
I suggest you flowchart the problem, execute it yourself by hand on the flowchart a few times to make sure it works, then convert the flowchart to code in whatever language the teacher told you to use.
That's what I did back in 1973 with my program to play tic-tac-toe, that I had to punch on cards using the FORTRAN II programming language when I first started on computers. Hand execution of a program though tedious and boring is a very effective means to find bugs and gain insight to the way computers operate.
What type of software is python?
Who created the Python programming language?
#LMGTFY
Guido van Rossum, a Dutch computer programmer is the author of the programming language Python. Among Python programmers and the Python community, van Rossum us known as the "Benevolent Dictator For Life" (BDFL).