answersLogoWhite

0


Best Answer

A string is placed between quotes, while integers are not quoted. If a string is not quoted, the computer will read each word as a separate filename instead of being a single string.

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you except a string in place of an integer in python?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How to write a C plus plus Program to convert a string into an integer?

std::string input = ""; std::getline (std::cin, input); // get input from stdin std::stringstream ss (input); // place input in a string stream integer num = 0; if (ss >> num) // extract integer from string stream { // Success! } else { // Fail! }


Is -3.2 an integer why?

No. Any number that has a decimal place is not an integer. Even if the decimal place is ".0".


Is a none repeating decimal an integer?

No, if it has a decimal place then its not an integer


What is the use of percent in printf statement in c?

It is a flag character that precedes the variable type place holder. %d %i Decimal signed integer. %o Octal integer. %x %X Hex integer. %u Unsigned integer. %c Character. %s String. See below. %f double %e %E double. %g %G double. %p pointer. %% %. No argument expected.


How does the Indian python get from place to place?

they are terrestrial so they crawl from places.


On an electric guitar can you place the second string in place of the first?

you can but you will no longer have an E string since a B string wont tune that high


Is five and one eighth considered an integer?

No. An integer is a WHOLE number. A number with a decimal place or a fraction is not an integer :)


What is a nonzero place value?

an integer


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.


What is the nearest tenth place for 82?

82 is an integer and so is already rounded to more than just the tenths place. So the answer is 82.82 is an integer and so is already rounded to more than just the tenths place. So the answer is 82.82 is an integer and so is already rounded to more than just the tenths place. So the answer is 82.82 is an integer and so is already rounded to more than just the tenths place. So the answer is 82.


What data structure does python use in place of arrays?

I believe Python's version of arrays is called dictionaries, although I am not completely sure and will have to check now...


Why not simply put the decimal integer into the original string as compared to the format specifier?

You can certainly do that ... printf ("This is a number: 12345\n"); ... but that does not have the same value as placing the value in a variable and converting the variable into a string ... int i = 12345; printf ("This is a number: %d\n", i); That's the whole point of format specifiers - to initiate a conversion from one place to another.