##################

ANSWERS FILE 

##################

q: Can Python be used for robotics?
a: Yes, MicroPython has taken the robotics industry by storm. From Arduino to Raspberry Pi, lots of embedded systems and IoT systems are using Python, embedded systems are the founding pillars of robotics.

Note: Answer the question given in Questions.txt file here along with the question.

q: Initilize a variable in python
a: var = "variable"

q: How to add multi-line comments in python


a: to add multi-line comments, use three """ and write your comment in between.
ie: 
"""
multi-line comment
"""
=======
a: python doesn't support multi line comments.
we have to comment each line individually.


q: What is the difference between local and global variables?
a: Local Variables are only acessed in functions or block where they are defined, while global variables can be acessed globally in whole program.


q: What is a variable?
a: Variable is a container for a particular type of data (like integer, float, String etc...)

q: What is the difference between a parameter and an argument?
- parameters are the name within the function definition.
- Parameters don’t change when the program is running

- Arguments are the values passed in when the function is called.
- Arguments are probably going to be different every time the function is called.


q: Make a program that asks the users preferred programming language.
a: input("Enter your preferred programming language: ")

q: Make a Python program that prints your name.
a: print("Faiz Un Nisa")


q: Make a program that displays the lyrics of a song.
a: import spotipy
   import spotipy.util as util
   from config.config import USERNAME, SPOTIPY_CLIENT_ID, SPOTIPY_CLIENT_SECRET, SPOTIPY_REDIRECT_URI
   scope = 'user-read-currently-playing'
   token = util.prompt_for_user_token(
      USERNAME, scope, client_id=SPOTIPY_CLIENT_ID, client_secret=SPOTIPY_CLIENT_SECRET, redirect_uri=SPOTIPY_REDIRECT_URI)
   if token:
      sp = spotipy.Spotify(auth=token)
      current_song = sp.currently_playing()
      artist = current_song['item']['artists'][0]['name']
      name_song = current_song['item']['name']
      print(artist, name_song)
    else:
      print("Can't get token for", USERNAME)



q: Make a program to calulate the percentage of students
a:  
eng, Islam, Maths=-5, -6, -8
TotalMarks=300
percent= (eng+lslam+Maths) / TotalMarks *100
if percent<100 and percent>80:
   print("Grade A+")
elif percent<80 and percent>70:
   print("Grade A")
elif percent<70 and percent>60:
   print("Grade B")
elif percent<60 and percent>50:
   print("Grade C")
elif percent<50 and percent>40:
   print("Grade D")
elif percent<40 and percent>30:
   print("Grade E")
elif percent>0 and percent<30:
   print(" Fail" )
elif percent>100:
   print("percent can't be greater than 100! ")
elif percent<0:
   print("percent can't be negative!")
else:
   print("Something wrong!)


q:Is python open source language?
a: Yes 

q: What is a syntax error?
a: Syntax error is the most basic type of error in programming. In python and popular languages, it is an error in the syntax of a sequence of characters or        tokens that is intended to be written in compile-time.

q: Take input from user in python
a:  a=input("Enter your value")

q: What is Expression?
a: An expression is a combination of values, variables, operators, and calls to functions. Expressions need to be evaluated. If you ask Python to print an expression, the interpreter evaluates the expression and displays the result.

// java hello world 

public class {
public static void main(String[] args){

System.out.Println("Hello world");
}
}

q: What is a syntax error?
a: Error found in the syntax of a sequence of tokens that is intended to be written in compile-time.

q: What is a logical error?
a: Mistake in a program's source code that results in incorrect or unexpected Behavior is simply a Logical Error.

