Questions tagged [python-3.9]

A version of the Python programming language, first released on October 5, 2020. This tag is for issues that are specific to Python 3.9. For general questions use the more generic [python] and [python-3.x] tags.

3.9 was released on October 5, 2020 (PEP 596).


Use this tag if your question is specifically related to Python 3.9. Otherwise, use the following guidelines to determine which tag(s) you should add to your question:

  • If your question applies to Python in general, use only the tag.
  • If your question applies to Python 3.x but not to Python 2.x, add the tag .
  • If you aren't sure, tag your question with and mention which version you're using in the post.

References

1128 questions
-1
votes
1 answer

Why am I getting unresolved reference to unicode and xrange

in the code snippet below the Pycharm ide says: def hexdump(src, length=16): result = [] if not isinstance(src, unicode): digits = 2 else: digits = 4 for i in xrange(0, len(src), length): s = src[i:i+length] …
jdftwrth
  • 45
  • 5
-1
votes
1 answer

python terminal close when I click enter

I click enter to enter input data and it closes. I am using windows ten, new computer, not glitchy. code is import os printput = input("Do: ") if printput == "send message": myinput = input("s:") print (myinput) pass elif printput == "clear…
J Bergh
  • 11
-1
votes
1 answer

I am making a Tic-Tac-Toe game using Python

This is my first time posting a question so I apologize if I missed any necessary details from my question. So here is the code, it is intended to play tic-tac-toe with the machine and everything goes right until the machine plays its turn and it…
V1c70r
  • 1
  • 2
-1
votes
1 answer

Character frequency in a string (Python 3.9)

How can you count the characters (characters frequency) in a string without using if, while or for?
Blue
  • 11
-1
votes
3 answers

Why is it necessary for "input()" to be at the end of the line ? Or is it?

I started my first course on udemy with the Automate things with python course. And it started with us writing a little script that asks us our name and age et c. Ok. So, when they have us write the code, it has us put in 2 separate lines that say…
Codynw42
  • 31
  • 5
-1
votes
1 answer

Making a command line login application except there seems to be an error

I am using this code: import requests import json import urllib.request import random enteredUserName = str(input("\n\nEnter your username to start signing in ≥ ")) stuff = json.loads(requests.get("https://pastebin.com/raw/HJxYck9H").text) #…
WhatTheClown
  • 464
  • 1
  • 7
  • 24
-1
votes
1 answer

name 'function' is not defined, but it is

What I'm trying to do: I am trying to return a command when it is called after you send a message. What I sent: command hello Result: function() NameError: name 'function' is not defined How can I fix this? Code: @bot.command() async def command(): …
raid6n
  • 55
  • 1
  • 7
-1
votes
2 answers

Efficient computation of the overlapping between sequences

Given two sequences s1 and s2, a supersequence of s1 and s2 is another sequences with length less than the sum of the lengths of s1 and s2 and that contains them. For example, for s1=[1,2,4,4], and s2=[4,4,9,7], a supersequence may be [1,2,4,4,9,7],…
Kikolo
  • 212
  • 1
  • 10
-1
votes
1 answer

Error installing matplotlib in python 3.9

When I installed matplotlib in Python 3.9 and write in IDLE import matplotlib The computer gives me the next error: What could I do??
-1
votes
1 answer

Sort a complex nested dictionary

Consider this dictionary format, how do I sort this complex nested dictionary by The WEIGHT or HEIGHT key: People = { 'person1': { 'name': 'John Cena', 'size': { 'height': 175, 'weight': 100 …
-1
votes
1 answer

env package incompatible with Python 3 being installed

I am using a MacOS 10.15.7. I did brew install python. python -V also result in python 3 version. But when i am installing packages with pip3 then packages written in python2 are getting installed here. What is wrong here? How to fix this? ap@Pro ~…
Ashish Pani
  • 933
  • 1
  • 12
  • 19
-1
votes
1 answer

How Can I Give the User 5 Lives for my script?

Title. I'm currently writing a choose your own adventure python script for my computer science class and need to give the player 5 lives and when they run out have a line of text appear. Any ideas? (I'm not sure if I need to post the script or not…
dilleyf
  • 1
  • 1
-1
votes
1 answer

Adding Python to PATH

I was trying to install XMM-NEWTON SAS to my device. But unfortunately, there is an error. Checking whether Python is in PATH ... No. Error: Please add python to your PATH ! I am using a bash shell and have installed python3.9. How can I rectify…
-1
votes
2 answers

Creating a vocabulary game

I am completely new to python. I have been creating a vocabulary program, but I want the to mix the words, so also the ones behind :. So far it keeps throwing only the ones in front of :. How can I achieve this? print() print('Welcome to german…
-1
votes
1 answer

Cannot install modules using pip - it gives an error

I uninstalled Python 3.8 and then installed Python 3.9. Now, when I try to install any module using pip: pip install pygame It shows this error: ERROR: Command errored out with exit status 1: command:…
SuPythony
  • 875
  • 8
  • 23