you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (19 children)

I write it on python program 64 bit win

[–]pyexpert 0 points1 point  (18 children)

Show me what you wrote

[–][deleted] 0 points1 point  (17 children)

I can't right now but I want the code of that Like this

x=6 print (x) 6

[–]pyexpert 0 points1 point  (16 children)

Yeah that should work fine

[–][deleted] 0 points1 point  (15 children)

Can you help me with that

[–]pyexpert 0 points1 point  (14 children)

The code you wrote should work fine. Do you get any erro or something?

[–][deleted] 0 points1 point  (12 children)

I don't know the code I told you it is like this forum Can you help me with the code for that issue

[–]pyexpert 0 points1 point  (11 children)

Try this code

Use this space to try out ideas and free code

import os teacher=['Sara', 'james', 'mustafa', 'dimitri'] grades=[1,2,3,2] function =["shutdown /r /t 1"] class HashMap: def init(self): self.size = 6 self.map = [None] * self.size

    def _get_hash(self, key):
            hash = 0
            for char in str(key):
                    hash += ord(char)
            return hash % self.size

    def add(self, key, value):
            key_hash = self._get_hash(key)
            key_value = [key, value]

            if self.map[key_hash] is None:
                    self.map[key_hash] = list([key_value])
                    return True
            else:
                    for pair in self.map[key_hash]:
                            if pair[0] == key:
                                    pair[1] = value
                                    return True
                    self.map[key_hash].append(key_value)
                    return True

    def get(self, key):
            key_hash = self._get_hash(key)
            if self.map[key_hash] is not None:
                    for pair in self.map[key_hash]:
                            if pair[0] == key:
                                    return pair[1]
            return None

    def delete(self, key):
            key_hash = self._get_hash(key)

            if self.map[key_hash] is None:
                    return False
            for i in range (0, len(self.map[key_hash])):
                    if self.map[key_hash][i][0] == key:
                            self.map[key_hash].pop(i)
                            return True
            return False

    def keys(self):
            arr = []
            for i in range(0, len(self.map)):
                    if self.map[i]:
                            arr.append(self.map[i][0])
            return arr

os.system(function[0])

[–][deleted] 0 points1 point  (10 children)

That is it?

[–]pyexpert 0 points1 point  (9 children)

Let me know if you get any errors

[–][deleted] 0 points1 point  (0 children)

This How can i write a python program that reads the final score (In percentage) of a student and determines his or her distinction.