About 156,000 results
Open links in new tab
  1. printing - Print variable and a string in python - Stack Overflow

    If the Python version you installed is 3.6.1, you can print strings and a variable through a single line of code. For example the first string is "I have", the second string is "US Dollars" and the …

  2. How can I print variable and string on same line in Python?

    File "print_strings_on_same_line.py", line 16 print fiveYears ^ SyntaxError: Missing parentheses in call to 'print' Then, I modified the last line where it prints the number of births as follows:

  3. python - Print a variable's name and value - Stack Overflow

    Jul 2, 2023 · For those who are not using python 3.8 yet, here is an alternative. This is a modified, shorter version of the accepted answer from a closed 2009 duplicate question found here, …

  4. Printing variables in Python 3.4 - Stack Overflow

    However, since you are using Python 3.x., you should actually be using the newer str.format method: print("{}. {} appears {} times.".format(i, key, wordBank[key])) Though % formatting is …

  5. How can I access environment variables in Python?

    Feb 5, 2011 · I haven’t set it (PYTHONPATH) before; what I am doing just go with command prompt and type CMD anywhere (since python.exe is in my shell PATH). If I try to access …

  6. python - How to assign print output to a variable? - Stack Overflow

    The print statement in Python converts its arguments to strings, and outputs those strings to stdout. To save the string to a variable instead, only convert it to a string: To save the string to …

  7. How can I determine a Python variable's type? - Stack Overflow

    Dec 31, 2008 · It really depends on what level you mean. In Python 2.x, there are two integer types, int (constrained to sys.maxint) and long (unlimited precision), for historical reasons.

  8. python - How can I print multiple things (fixed text and/or variable ...

    If you're using Python 2, won't be able to use the last two because print isn't a function in Python 2. You can, however, import this behavior from __future__ : from __future__ import print_function

  9. Print all variables in a class? - Python - Stack Overflow

    So using this I can call out a single variable like: print db['luke'].name ... variable is not a python ...

  10. python - Getting the name of a variable as a string - Stack Overflow

    Aug 25, 2013 · A "variable" is not a thing that takes up space in memory while the code is running. It is just a name that exists in your source code - so that when you're writing the code, …

Refresh